View source: R/is_valid_state.R
is_valid_state | R Documentation |
Returns TRUE if the given state is a valid state spelling given our state spelling naming conventions. Under our conventions, spellings include the 50 states spelled out (e.g. "Alabama"), "District of Columbia", the five populated U.S. territories, and "Not Available" (e.g. for federal facilities without a known state designation). Includes a parameter to return FALSE vs. NA if the given state spelling is NA.
is_valid_state(state, missing_as_na = T)
state |
character string of the state to check |
missing_as_na |
logical, whether NA should return NA (vs. FALSE) |
logical, TRUE if the given state is a valid state spelling
is_valid_state("DC") is_valid_state(c("DC", NA, "District of Columbia"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.