DataEditR 2.0 is
a rewrite of the data editor. The grid is now built on the MIT-licensed
Tabulator JavaScript library
instead of rhandsontable, the user interface has been
redesigned around a single toolbar, and the editor can now edit tables
stored in databases. Code that uses data_edit() keeps
working: all arguments are unchanged, only the defaults of
theme and logo look different.
Ctrl+Z
/ Ctrl+Y), including pasted ranges, fills, added or removed
rows and columns and renamed columns.Delete to clear a range,
and a fill handle to drag that copies values or carries on series such
as 1, 2, 3, dates or Week 1, Week 2
(Ctrl+D fills down). Pastes wider than the table add
columns.col_options:
date-times, times, text over several lines, web addresses, colours (with
a colour picker that knows R’s colour names), numbers within limits,
sliders and star ratings, as well as checkboxes, dropdown menus, dates
and passwords.Code tab with the code that reproduces your
edits, updated as you edit.round(mpg * 0.425, 1) as a new column), find and replace,
recoding values, changing types and sorting from a column’s menu, each
previewed and shown in the code as one dplyr verb.Form tab shows the
selected row as a form, to enter or check data one record at a
time.Shift+F2) to leave a comment, returned with the data as
attr(x, "comments").haven, and their variable labels, value
labels and missing values are shown, edited (Labels... in a
column’s menu) and kept in the returned data and the code. Typing or
pasting a label stores its value.rules = list("End is after the start" = ~ end >= start),
or required, unique, limits and patterns from a column’s menu. Cells
that break a rule are marked and listed in a Problems tab,
and Done asks before returning them.History tab
lists every change with when it was made and by whom, and each step can
be given a note saying why. data_edit(log = "changes.csv")
keeps this record in a file and lists the earlier sessions kept in it,
and dataEditCommit() returns it in shiny apps.Done (or R crashes) you are offered your changes the next
time you open the same data. Cancel asks before changes are
thrown away.Filters panel beside the grid that lists
every filter in one place for complex combinations: histograms with a
range to drag for numbers and dates, value lists with counts, matching
all or any of the filters, and all the logics of earlier versions. The
grid follows the panel as you change it. Active filters are shown as
chips in the toolbar.page_rows and
page_cols), and the data can be renamed by clicking its
name in the header.Ctrl+F), a status
bar with the sum, mean and count of the selected cells, and a
sheet of keyboard shortcuts (?).TRUE/FALSE column, or a value outside a
column’s options or limits, makes the editor ask whether to store
NA, convert the column to text or cancel, instead of
silently converting the column.Rows in the toolbar loads the
rows matching a filter, sorted by a column, with the database doing the
work. Queries that cannot be written back (SQL, joins, Parquet files
through DuckDB) open read-only.dbplyr table
(e.g. data_edit(tbl(con, "cars"))) to edit it in place.
Changes are written in a single transaction after you confirm them, with
checks for changes made by others. See
vignette("databases").dataEditCommit() saves the changes made in a
dataEditServer() editor (writing them to a database when
the data is a database table) and dataEditChanges() counts
the changes that have not been saved yet. See
vignette("shiny-modules").If you used earlier versions of DataEditR, this is where the controls of the old interface have moved to:
| DataEditR 1.x | DataEditR 2.0 |
|---|---|
| “Data to edit” box and file upload | Open menu in the toolbar |
| Filter button (funnel) | Filters panel, or the boxes under the column
headers |
| Select columns button (crosshairs) | Select menu, or Hide column in a column’s
menu |
| Sync button | not needed: edits to filtered data apply to all data |
| Cut button (scissors) | Done menu: return all data or only what’s on
screen |
| Download buttons | Export menu: all data or only what’s on screen |
| Blue borders around changed cells | blue tint (track = TRUE), plus the review panel |
theme = NULL). Bootswatch names such as
"yeti" now select the Bootstrap 5 version of the theme, and
custom bslib::bs_theme() objects should use
version = 5.logo to show one.col_options no longer disables adding or removing
columns.col_readonly columns are locked in the grid (shown with
a lock) rather than reverted after editing.type.convert() when the data is returned, so character
columns such as "001" are no longer converted to numbers.
Their cells that were never filled in are returned as NA
rather than empty strings.col_factor = TRUE;
col_factor = TRUE now only turns character columns into
factors."NA" typed into a number, date or logical column is a
missing value.Cancel asks for confirmation when there are changes,
and data_edit() saves drafts of unsaved changes
(autosave = TRUE).between and not between filters include
their end points (they were left out before), and contains
looks for plain text and ignores case. Use
matches the pattern for regular expressions.NULL.rhandsontable, shinyBS and
miniUI are no longer needed. The forked version of
rhandsontable that earlier versions required is therefore
no longer required either. DBI, dbplyr and a
database backend (e.g. RSQLite) are only needed to edit
database tables.
DataEditR remains licensed under GPL-2. It bundles
Tabulator 6.7.1 (MIT licence) and icons based on Lucide (ISC licence),
both compatible with GPL-2; the COPYRIGHTS file installed
with the package lists their copyright notices.
dataEditUI() gains height,
toolbar, toolbar_left and
toolbar_right arguments to control the layout around the
grid.dataEditServer() gains rows and
columns arguments to show part of the data; edits apply
directly to the complete data, so row_index and
dataSync are no longer needed. The returned reactive
carries a "view" attribute with only the rows and columns
on screen.dataEditCommit() saves the changes made in the
module: database changes are written in a single transaction and the
rows read back, and for other data the current data becomes the new
starting point. dataEditChanges() summarises the changes
that have not been saved yet.dataFilterServer() and dataSelectServer()
gain a reset argument and dataSelectServer()
returns the selected column names.See vignette("shiny-modules") for examples, and the changelog
for the full list of changes.