Thursday 15 January 2015

string - How to insert a colon between columns in r -



string - How to insert a colon between columns in r -

i have info frame 3 columns

chr start end chr1 1111 2222 chr1 3333 4444

and on. want info frame looks 1 below (with colon between chr , start columns)

chr start end id chr1 1111 2222 chr1:1111 chr1 3333 4444 chr1:3333

and on. can suggest solutions thanks

if dataframe called df using paste or paste0 jealie mentioned give asked result.

df$id <- paste0(df$char,”:”,df$start)

r string

No comments:

Post a Comment