三生石@ 2011-08-26 07:25 采纳率: 100%
浏览 1581

如何连接两个字符串?

How can I concatenate (merge, combine) two values? For example I have:

tmp = cbind("GAD", "AB")
tmp
#      [,1]  [,2]
# [1,] "GAD" "AB"

My goal is to concatenate the two values in "tmp" to one string:

tmp_new = "GAD,AB"

Which function can do this for me?

转载于:https://stackoverflow.com/questions/7201341/how-can-two-strings-be-concatenated

  • 写回答

11条回答 默认 最新

  • derek5. 2011-08-26 07:33
    关注
    > tmp = paste("GAD", "AB", sep = ",")
    > tmp
    [1] "GAD,AB"
    

    I found this from Google by searching for R concatenate strings: http://stat.ethz.ch/R-manual/R-patched/library/base/html/paste.html

    评论

报告相同问题?

悬赏问题

  • ¥15 Error in check.length("fill") : 'gpar'成分'fill'的长度不能为零
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导