<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/dt-0-4-editing-tables-smart-filtering-and-more/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://blog.rstudio.com/2018/03/29/dt-0-4/"> RStudio Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>It has been <a rel="nofollow" href="https://blog.rstudio.com/2015/06/24/dt-an-r-interface-to-the-datatables-library/" target="_blank">more than two years</a> since we announced the initial version of the <strong>DT</strong> package. Today we want to highlight a few significant changes and new features in the recent releases v0.3 and v0.4. The full changes can be found in the <a rel="nofollow" href="https://github.com/rstudio/DT/releases" target="_blank">release notes</a>.</p>
<h2>Editable tables</h2>
<p>Now you can make a table editable through the new argument <code>datatable(..., editable = TRUE)</code>. Then you will be able to edit a cell by double-clicking on it. This feature works in both client-side and server-side (Shiny) processing modes. See <a rel="nofollow" href="https://github.com/rstudio/DT/pull/480" target="_blank">here for examples</a>.</p>
<p><img alt="An editable tables" src="https://i0.wp.com/user-images.githubusercontent.com/163582/38057156-1c0cce84-32a4-11e8-84ac-1c93ec60684e.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h2>Smart filtering in the server-side processing mode</h2>
<p>Searching in the server-side processing mode has enabled <a rel="nofollow" href="https://datatables.net/reference/option/search.smart" target="_blank">the “smart” mode</a> by default. Previously, this mode only works in the client-side processing mode. If you want to disable the smart filtering, you can set the initialization option in <code>datatable()</code> (e.g., <code>options = list(search = list(smart = FALSE))</code>). The smart filtering means spaces in the global search keyword for the table will have a special meaning: each returned record in the table should match <em>all</em> of the words separated by spaces. For example, a keyword “1234 abc” will match every record in the table that contain both “1234” and “abc” (in previous versions, this is just treated as a single keyword).</p>
<p><img alt="Smart filters in DataTables" src="https://i1.wp.com/user-images.githubusercontent.com/163582/38057956-bedfad96-32a6-11e8-815c-73abce2d74bc.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h2>Shift + Clicking for row selection</h2>
<p>After you have enabled <a rel="nofollow" href="https://rstudio.github.io/DT/shiny.html" target="_blank">row selection</a>, you can hold the <code>Shift</code> key and click to select multiple consecutive rows.</p>
<h2>DTOutput() and renderDT() for Shiny apps</h2>
<p>We have added functions <code>DTOutput()</code> and <code>renderDT()</code> as aliases of <code>dataTableOutput()</code> and <code>renderDataTable()</code>, respectively. This is because the latter two often collide with functions of the same names in <strong>shiny</strong>. You are recommended to use <code>DTOutput()</code> and <code>renderDT()</code> in Shiny apps, so that you don’t have to worry about forgetting the <code>DT::</code> qualifier (e.g., <code>DT::renderDataTable</code>). Naming is hard, and this was perhaps my biggest mistake in the initial version of <strong>DT</strong>. I was too optimistic that <code>DT::renderDataTable()</code> could quickly and easily replace <code>shiny::renderDataTable()</code> so we could drop the latter. It turned out that the two were not completely compatible initially, and had got more and more differences later (<strong>DT</strong> has many more features).</p>
<p>Versions 0.3 and 0.4 also include several bug fixes, and we appreciate all the bug reports and pull requests from <strong>DT</strong> users. In particular, we want to thank Xianying Tan (<a rel="nofollow" href="https://github.com/shrektan" target="_blank">@shrektan</a>) for his many helpful pull requests to implement new features and fix bugs.</p>
<p>Again, the full documentation is at <a rel="nofollow" href="https://rstudio.github.io/DT/" target="_blank">https://rstudio.github.io/DT/</a>. Please use <a rel="nofollow" href="https://github.com/rstudio/DT/issues" target="_blank">Github issues</a> if you want to file bug reports or feature requests, and use <a rel="nofollow" href="https://stackoverflow.com/questions/tagged/dt" target="_blank">StackOverflow</a> or <a rel="nofollow" href="https://community.rstudio.com/" target="_blank">RStudio Community</a> if you have questions.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://blog.rstudio.com/2018/03/29/dt-0-4/"> RStudio Blog</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/-EmuU0HfcqI" height="1"></a></div>