replace_values_in_list | R Documentation |
Iterates through a list and replaces values with replacements.
replace_values_in_list(x, old, new)
x |
List object. |
old |
List or vector of values to replace. |
new |
List or vector of replacement values. |
A list with values replaced.
Other helper functions: capitalize_words
,
ch1903_to_wgs84
,
clean_strings
,
format_addresses
,
format_scientific_names
,
is.empty
, lvapply
,
melt_by_listcol
, na.remove
,
normalize_language
,
parse_scientific_names
,
quotemeta
, sp_transform
,
subset_search_results
,
unique_na
str(x <- list(NULL, list(NULL, NA, 2)))
str(replace_values_in_list(x, NULL, 1))
str(replace_values_in_list(x, list(NULL, NA), 1))
str(replace_values_in_list(x, list(NULL, NA), list(1, 2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.