Are these valid names?

validNames(x, .xname = getNameInParent(x))

Arguments

x

Object.

.xname

Not intended to be used directly.

Value

TRUE on success; FALSE on failure, with cause attribute set.

See also

Examples

## TRUE ==== ## Dots (periods) and underscores are valid. validNames(c("sample.1", "sample_1"))
#> [1] TRUE
## FALSE ==== ## Can't begin with a number. validNames("293cells")
#> [1] FALSE #> Cause of failure: #> "293cells" does not contain valid names. #> See make.names() for details.
## Spaces, dashes (hyphens), and other non-alphanumerics aren't valid. validNames("sample 1")
#> [1] FALSE #> Cause of failure: #> "sample 1" does not contain valid names. #> See make.names() for details.
validNames("cell-AAAAAAAA")
#> [1] FALSE #> Cause of failure: #> "cell-AAAAAAAA" does not contain valid names. #> See make.names() for details.
validNames("GFP+")
#> [1] FALSE #> Cause of failure: #> "GFP+" does not contain valid names. #> See make.names() for details.