The R package DT v0.2 is on CRAN now. You may install it from CRAN via
install.packages('DT') or update your R packages if you have already installed it before. It has been over a year since the last CRAN release of DT, and there have been a lot of changes in both DT and the upstream DataTables library. You may read the release notes to know all changes, and we want to highlight two major changes here:
Two extensions “TableTools” and “ColVis” have been removed from DataTables, and a new extension named “Buttons” was added. See this page for examples.
For tables in the server-side processing mode (the default mode for tables in Shiny), the selected row indices are integers instead of characters (row names) now. This is for consistency with the client-side mode (which returns integer indices). In many cases, it does not make much difference if you index an R object with integers or names, and we hope this will not be a breaking change to your Shiny apps.
In terms of new features added in the new version of DT, the most notable ones are:
Besides row selections, you can also select columns or cells. Please note the implementation is not based on the “Select” extension of DataTables, so not all features of “Select” are available in DT. You can find examples of row/column/cell selections on this page.
There are a number of new functions to modify an existing table instance in a Shiny app without rebuilding the full table widget. One significant advantage of this feature is it will be much faster and more efficient to update certain aspects of a table, e.g., you can change the table caption, or set the global search keyword of a table without making DT to create the whole table from scratch. You can even replace the data object behind the table on the fly (using
DT::replaceData()), and after the data is updated, the table state can be preserved (e.g., sorting and filtering can remain the same).
A few formatting functions such as
formatString() were also added to the package.
RStudio has many tools for both R and Python programmers. In this blog post, we’ll showcase various ways that you can program in Python with RStudio tools.
In this series, we walk through lesser-known tips and tricks to help you work more effectively and efficiently in R Markdown. This first post focuses on working with R Markdown in the RStudio IDE.