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

replaceData

Replace data in an existing table


Description

Replace the data object of a table output and avoid regenerating the full table, in which case the state of the current table will be preserved (sorting, filtering, and pagination) and applied to the table with new data.

Usage

replaceData(proxy, data, ..., resetPaging = TRUE, clearSelection = "all")

Arguments

proxy

a proxy object created by dataTableProxy()

data

the new data object to be loaded in the table

...

other arguments to be passed to dataTableAjax()

resetPaging, clearSelection

passed to reloadData()

Note

When you replace the data in an existing table, please make sure the new data has the same number of columns as the current data. When you have enabled column filters, you should also make sure the attributes of every column remain the same, e.g. factor columns should have the same or fewer levels, and numeric columns should have the same or smaller range, otherwise the filters may never be able to reach certain rows in the data.


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.