r - How to make syntactically correct names -
how can modify add _ (underscore) in place of . (dot) default value.
> make.names(c("a , b", "a-and-b"), unique = true) [1] "a.and.b" "a.and.b.1" looking following result "a_and_b" "a_and_b_1"
you enclose make.names gsub:
gsub("\\.", "_", make.names(c("a , b", "a-and-b"), unique = true)) # [1] "a_and_b" "a_and_b_1"
Comments
Post a Comment