插入逗号分隔粘贴功能

时间:2015-03-16 20:38:59

标签: r paste comma

我想显示这样的矢量:(使用粘贴功能)

("Label 1", "Label 2", ..., "Label 7")

但是,当我使用粘贴功能

  

粘贴("标签",1:7)

它是这样的:

[1] "label 1"  "label 2"  "label 3"  "label 4"  "label 5"  "label 6"  "label 7"  #without the "comma" between characters.

或尝试其他方式

  

粘贴("标签",1:7,",")

[1] "label 1 ,"  "label 2 ,"  "label 3 ,"  "label 4 ,"  "label 5 ,"  "label 6 ,"  [7] "label 7 ,"   # the "comma" came inside the quotation marks

粘贴功能中缺少什么?

1 个答案:

答案 0 :(得分:0)

dput(paste("Label", 1:7))

给出

c("Label 1", "Label 2", "Label 3", "Label 4", "Label 5", "Label 6",
"Label 7")