Is the Name Ok According to Our Best Practices?

name_is_ok(x, mildness = 1)

Arguments

x

vector of character

mildness

level of mildness. 1: not mild, all characters must be hyphen or alphanumeric or dot or underscore, 2: more mild, all characters must be one of the above or space

Value

vector of logical as long as x

Examples

name_is_ok(c("a", "$", ".", " "))
#> [1] TRUE FALSE TRUE FALSE
name_is_ok(c("a", "$", ".", " "), mildness = 2)
#> [1] TRUE FALSE TRUE TRUE