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 -

image - ClassNotFoundException when add a prebuilt apk into system.img in android -