mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
263 stars 30 forks source link

Check on names does not error when using R keywords [suggestion] #235

Open sebffischer opened 2 years ago

sebffischer commented 2 years ago

I think the strict check on names should include R keywords.

 checkmate::test_names("for", type = "strict")
#> [1] TRUE

Created on 2022-10-03 by the reprex package (v2.0.1)

billdenney commented 1 year ago

While R tries to stop you at a first pass, it is possible to have a name of "for":

a <- data.frame("for" = 4)
a
#>   for.
#> 1    4
setNames(a, "for")
#>   for
#> 1   4

Created on 2023-09-28 with reprex v2.0.2