View source: R/nms_manipulate_names.R
nms_try_rename | R Documentation |
Given a name you want and a possible alternative, this function renames an object as you want or errs with an informative message.
nms_try_rename(x, want, try)
x |
A named object. |
want |
String of length 1 giving the name you want the object to have. |
try |
String of length 1 giving the name the object might have. |
nms
Other functions for developers:
check_crucial_names()
,
extract_insensitive()
,
flag_if_group()
,
is_multiple()
,
rename_matches()
,
type_ensure()
nms_try_rename(c(a = 1), "A", "a")
nms_try_rename(data.frame(a = 1), "A", "a")
# Passes
nms_try_rename(c(a = 1, 1), "A", "a")
## Not run:
# Errs
# nms_try_rename(1, "A", "A")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.