How can two strings be concatenated?

前端 未结 12 1880
时光说笑
时光说笑 2020-11-22 16:14

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

tmp = cbind(\"GAD\", \"AB\")
tmp
#      [,1]  [,2]
# [1,] \"GAD\" \"AB\"
12条回答
  •  执笔经年
    2020-11-22 16:19

    Another way:

    sprintf("%s you can add other static strings here %s",string1,string2)
    

    It sometimes useful than paste() function. %s denotes the place where the subjective strings will be included.

    Note that this will come in handy as you try to build a path:

    sprintf("/%s", paste("this", "is", "a", "path", sep="/"))
    

    output

    /this/is/a/path
    

提交回复
热议问题