View source: R/filter_st_name.R
include_states | R Documentation |
Select only rows with given (types of) Indian states or Union Territories
include_states( df, ..., state_col_name = NULL, fixed = FALSE, ignore_case = TRUE )
df |
An object with class data.frame that has a column of Indian states. |
... |
State or Union Territory names either in full or in part. Case insensitive. Accepts symbols (bare text) or quoted strings (see details below). If a symbol refers to a character vector in the global environment, the vector contents and not the symbol will be part of the search. The following options are special and can be used in addition to others both as strings and as symbols:
|
state_col_name |
If more than column is known to be present, introduce the name of the correct column here as a string. |
fixed |
should the names be matched strictly. |
ignore_case |
should case be ignored. |
The elements from ... are processed and coerced into a string
vectorthat is then turned into a regex by cptools::bound_rx(vector,
"", "")
ignoring case.
include_states(df, and, "Mizoram", my_states)
will include Andhra
Pradesh, Mizoram and the contents of my_states
if it is a character
vector in the call stack.
The same data.frame object WITH ONLY rows referring to the relevant states
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.