viewdt() is the modern ViewR data explorer: a
dependency-free htmlwidget built in
plain vanilla JavaScript. It profiles every column in R
and renders a virtualized grid with Kaggle-style micro-dashboard
headers, a Data Insights drawer, a visual query builder, a column
picker, and a reproducible code generator.
It is distinct from the legacy Shiny-gadget [ViewR()],
which remains available for in-session viewing and editing.
viewdt() reads label column attributes (as
produced by haven or ADaM clinical datasets) and shows
them inline beneath each column name:
Disable any panel you do not need — for example a minimal read-only grid with no query builder, code export, or insights drawer:
Each header is a small dashboard:
# numeric, A
character, T/F logical, clock = date.ⓘ icon for a full
metadata card.Click Filter to build multi-condition rules combined
with AND / OR. Operators are type-aware:
numeric columns get <, >,
=; character columns add contains,
is in, and is not in with a searchable
multi-select. The live row/column counter on the right updates
instantly.
Click Code to copy the exact pipeline that reproduces your current filter and visible-column state, in three dialects:
# dplyr
mtcars %>%
filter(cyl == 6, mpg > 20) %>%
select(mpg, cyl, hp)
# base R
mtcars[mtcars$cyl == 6 & mtcars$mpg > 20, c("mpg", "cyl", "hp")]
# SQL
SELECT mpg, cyl, hp
FROM mtcars
WHERE cyl = 6
AND mpg > 20;The data variable name is auto-substituted from the object you passed
to viewdt().
[save_viewdt()] writes a fully offline, interactive HTML
file that opens in any browser without R: