A Positron/VS Code extension for R developers with three main features:
- Tibble Explorer — Hover on tibble/data.frame names to open them in the Data Explorer or Simple Data Viewer
- Simple Data Viewer — Lightweight RStudio-style data viewer with column filters
- Code Section Folding — RStudio-style collapsible code sections using
# Section ----markers
Quickly inspect your data frames without leaving your code:
- Hover over any tibble/data.frame variable to see a quick action link to open it in the Data Explorer
- Smart Detection — automatically recognizes variables created with common patterns
- Pipe Chain Support — works with tidyverse pipes (
%>%and|>)
my_data <- tibble(
x = 1:10,
y = rnorm(10)
)
# Hover on 'my_data' anywhere to view it in Data Explorer
my_data %>%
filter(x > 5)The extension detects tibbles/data.frames created with:
| Category | Functions |
|---|---|
| Creation | tibble(), tribble(), data.frame(), as_tibble(), as.data.frame() |
| Import | read_csv(), read_tsv(), read_excel(), read.csv(), fread() |
| Transform | mutate(), select(), filter(), summarize(), *_join(), pivot_*() |
A lightweight data viewer inspired by RStudio's View() function, with filter inputs on each column.
- Column Filters — Type in the filter box above any column to filter rows
- Lightweight — Simple HTML table, fast and responsive
- 1000 Row Preview — Shows first 1000 rows for large datasets
- Copy/Paste Workflow — Works via clipboard for maximum compatibility
- Place cursor on a data frame variable
- Press
Ctrl+Shift+Vor run command "Rview: Open in Simple Data Viewer" - The data loads automatically from your R session
- Click column headers to sort (ascending → descending → remove)
- Multi-level sorting: Click additional columns while holding sort to add secondary/tertiary sorts
- Sort indicators show the sort order (1↑, 2↓, etc.)
- Drag the border between column headers to resize
┌────────────────────────────────────────────────────────┐
│ 📊 my_data 100 rows × 5 cols │
├────────────────────────────────────────────────────────┤
│ [Filter...] │ [Filter...] │ [Filter...] │ [Filter...] │
├─────────────┼─────────────┼─────────────┼──────────────┤
│ name │ age │ city │ score │
├─────────────┼─────────────┼─────────────┼──────────────┤
│ Alice │ 25 │ New York │ 95 │
│ Bob │ 30 │ Boston │ 87 │
│ ... │ ... │ ... │ ... │
└────────────────────────────────────────────────────────┘
Organize long R scripts with collapsible sections, just like in RStudio.
To enable RStudio-style folding, configure Positron to use this extension as the folding provider:
- Open Settings (
Ctrl+,) - Search for
folding strategy - Set Rview as the
Default Folding Range Provider
Or add this to your settings.json:
"editor.foldingStrategy": "auto"Create a foldable section by ending a comment line with 4 or more dashes:
# Load Data ----
data <- read_csv("file.csv")
data2 <- read_excel("file.xlsx")
# Clean Data ----
data <- data %>%
filter(!is.na(value)) %>%
mutate(new_col = value * 2)
# Analysis ----
model <- lm(y ~ x, data = data)
summary(model)Or by starting a comment with 4 or more hash marks:
#### Load Data ####
data <- read_csv("file.csv")
#### Clean Data ####
data <- data %>%
filter(!is.na(value))- Click the fold icon in the gutter (left margin) next to section headers
- Or use keyboard shortcuts:
Ctrl+Shift+[— Fold sectionCtrl+Shift+]— Unfold section
- Positron IDE (recommended) or VS Code with R extension
- R language support enabled
-
Download or clone the repository
git clone https://github.com/eduaguilera/rview.git cd rview -
Install dependencies and compile
npm install npm run compile
-
Package the extension
npm install -g @vscode/vsce vsce package
This creates a
rview-1.0.0.vsixfile. -
Install in VS Code/Positron
- Open VS Code or Positron
- Press
Ctrl+Shift+Pand type "Install from VSIX" - Select the
rview-1.0.0.vsixfile - Reload the window when prompted
Coming soon
| Command | Shortcut | Description |
|---|---|---|
rview.openInDataExplorer |
Ctrl+Shift+D |
Open in Positron Data Explorer |
rview.openSimpleViewer |
Ctrl+Shift+V |
Open in Simple Data Viewer |
- Tibble detection uses heuristics and may not catch all data frame variables
- The variable must exist in the R session memory for Data Explorer to work
npm install
npm run compilePress F5 to launch the Extension Development Host for testing.
MIT