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

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

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -