paste column values to another column

后端 未结 2 1756
灰色年华
灰色年华 2021-01-20 15:30

I have a simple questions that possibly can be solved with paste My data frame looks like this:

x<-c(3,6,7)
y<-c(0.25,0.35,0.62)
dta1<         


        
2条回答
  •  别那么骄傲
    2021-01-20 15:57

    You just need to trim the string and combine with paste, so something like:

    paste0(x, "(", substr(y, 2, nchar(y)), ")")
    

    will give you what you are after

提交回复
热议问题