checkmate icon indicating copy to clipboard operation
checkmate copied to clipboard

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

Open sebffischer opened this issue 1 year ago • 1 comments

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)

sebffischer avatar Oct 03 '22 13:10 sebffischer

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

billdenney avatar Sep 29 '23 01:09 billdenney