editData: Edit a data object using the information from the editor in a...

View source: R/utils.R

editDataR Documentation

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


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.


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



The original data object used in the DataTable.


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, col, 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.


Whether row names are displayed in the table.


The updated data object.


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

DT documentation built on Oct. 5, 2023, 5:09 p.m.