R and DT: Show filter option on specific columns
<p>I want to use <a href="https://rstudio.github.io/DT/" rel="nofollow noreferrer">DT</a> to display some data and allow filtering on only some of the columns. This code:</p>

<pre><code>df &lt;- data.frame(c("john","susy"), c("a", "b"))
names(df) &lt;- c("name", "grade")
DT::datatable(df, filter = 'top')
</code></pre>

<p>Creates a table with filtering options over each column:</p>

<p><img src="https://s27.postimg.org/hsa92aavn/image.png" alt=""></p>

<p>Now say I only want to have the filter box visible for the "name" column. How do I do that? I thought I could use filter like this:</p>

<pre><code>df &lt;- data.frame(c("john","susy"), c("a", "b"))
names(df) &lt;- c("name", "grade")
DT::datatable(df, filter = c('none', 'top'))
</code></pre>

<p>To only enable it on the second column, but it doesn't work (it only takes a single character argument). Any ideas? Note that I want the top right search box to search on all fields, but I only want the column-specific box over the second column.</p>