View source: R/filter_st_name.R
exclude_states | R Documentation |
Exclude (types of) Indian states or Union Territories
exclude_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 vector
that is then turned into an atomic regex by cptools::bound_rx(vector,
"", "")
, and finally passed to grepl
.
exclude_states(df, and, "Mizoram", my_states)
will exclude Andhra
Pradesh, Mizoram and the contents of my_states
if it is a character
vector in the call stack.
The same object WITHOUT rows referring to the relevant states
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.