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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -