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

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -