doColumnSearch | R Documentation |
doGlobalSearch()
can be used to search a data frame given the search
string typed by the user into the global search box of a
datatable
. doColumnSearch()
does the same for a vector
given the search string typed into a column filter. These functions are used
internally by the default filter
function passed to
dataTableAjax()
, allowing you to replicate the search results
that server-side processing returns.
doColumnSearch(x, search_string, options = list())
doGlobalSearch(data, search_string, options = list())
x |
a vector, the type of which determines the expected
|
search_string |
a string that determines what to search for. The format depends on the type of input, matching what a user would type in the associated filter control. |
options |
a list of options used to control how searching character
values works. Supported options are |
data |
a data frame |
An integer vector of filtered row indices
The column filters section online for search string formats: https://rstudio.github.io/DT/
Accessing the search strings typed by a user in a Shiny app: https://rstudio.github.io/DT/shiny.html
doGlobalSearch(iris, "versi")
doGlobalSearch(iris, "v.r.i", options = list(regex = TRUE))
doColumnSearch(iris$Species, "[\"versicolor\"]")
doColumnSearch(iris$Sepal.Length, "4 ... 5")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.