将字符向量转换为带引号和逗号的字符串

时间:2016-05-19 03:12:16

标签: r string

彻底搜索后,我仍然坚持这个(相当小但仍然很烦人)的问题:

我有一个角色矢量:

x <- c("a", "b", "c")

我想得到一个完全符合表格的字符串:

"a", "b", "c"

我尝试了cat()paste()函数的无数组合,以及sepcollapse的组合,使用\"...但无法使其正常工作。

1 个答案:

答案 0 :(得分:0)

你想要一个带引号的字符串吗?你走了:

 perpageitem: number = 5;
 onChange(newValue){
     this.selectedDevice=newValue;
     this.perpageitem = newValue;
  }