Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

editData

Edit a data object using the information from the editor in a DataTable


Description

When editing cells in a DataTable in a Shiny app, we know the row/column indices and values of the cells that were edited. With these information, we can update the data object behind the DataTable accordingly.

Usage

editData(data, info, proxy = NULL, rownames = TRUE, resetPaging = FALSE, ...)

Arguments

data

The original data object used in the DataTable.

info

The information about the edited cells. It should be obtained from input$tableId_cell_edit from Shiny, and is a data frame containing columns row, column, and value.

proxy, resetPaging, ...

(Optional) If proxy is provided, it must be either a character string of the output ID of the table or a proxy object created from dataTableProxy(), and the rest of arguments are passed to replaceData() to update the data in a DataTable instance in a Shiny app.

rownames

Whether row names are displayed in the table.

Value

The updated data object.

Note

For factor columns, new levels would be automatically added when necessary to avoid NA coercing.


DT

A Wrapper of the JavaScript Library 'DataTables'

v0.18
GPL-3 | file LICENSE
Authors
Yihui Xie [aut, cre], Joe Cheng [aut], Xianying Tan [aut], JJ Allaire [ctb], Maximilian Girlich [ctb], Greg Freedman Ellis [ctb], Johannes Rauh [ctb], jQuery contributors [ctb, cph] (jQuery in htmlwidgets/lib), SpryMedia Limited [ctb, cph] (DataTables in htmlwidgets/lib), Brian Reavis [ctb, cph] (selectize.js in htmlwidgets/lib), Leon Gersen [ctb, cph] (noUiSlider in htmlwidgets/lib), Bartek Szopka [ctb, cph] (jquery.highlight.js in htmlwidgets/lib), RStudio, PBC [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.