Are these valid names?

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

Arguments

x

Object.

.xname

Name of object defined in x. Not intended to be used directly.

Value

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

Note

Updated 2019-08-11.

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: '"293cells"' does not contain valid names: [1] 293cells #> See 'make.names()' for details.
## Spaces, dashes (hyphens), and other non-alphanumerics aren't valid. validNames("sample 1")
#> [1] FALSE #> Cause: '"sample 1"' does not contain valid names: [1] sample 1 #> See 'make.names()' for details.
validNames("cell-AAAAAAAA")
#> [1] FALSE #> Cause: '"cell-AAAAAAAA"' does not contain valid names: [1] cell-AAAAAAAA #> See 'make.names()' for details.
validNames("GFP+")
#> [1] FALSE #> Cause: '"GFP+"' does not contain valid names: [1] GFP+ #> See 'make.names()' for details.