check-scalar-hasValidNames | R Documentation |
Does the input object have syntactically valid names?
hasValidNames(x)
hasValidDimnames(x)
x |
Object. |
TRUE
on success;
FALSE
on failure, with cause set.
Updated 2022-05-13.
validNames()
.
## TRUE ====
x <- list("a" = 1L, "b" = 2L)
print(names(x))
print(hasValidNames(x))
x <- datasets::iris
print(hasValidDimnames(x))
## FALSE ====
x <- list(
"1" = 1, # can't start with number
"foo bar" = 2, # no spaces
"foo-bar" = 3 # no hyphens
)
print(x)
print(hasValidNames(x))
x <- datasets::mtcars
print(hasValidDimnames(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.