标签: r
如何将c(mpg,cyl,disp,hp,drat,wt)转换为c("mpg","cyl","disp","hp","drat","wt")?
c(mpg,cyl,disp,hp,drat,wt)
c("mpg","cyl","disp","hp","drat","wt")
我需要为向量中的每个元素添加额外的双引号
答案 0 :(得分:1)
尝试
paste(quote(c(mpg,cyl,disp,hp,drat,wt)))[-1]
或者
as.character(substitute(c(mpg,cyl,disp,hp,drat,wt)))[-1]