Adding new line in R

后端 未结 1 1862
情歌与酒
情歌与酒 2021-01-29 12:49

I need to add a new line after the ;. My data looks like this:

(1,60112_486_100_xxx_BS);(1,1_486_100_yyy_TE);

I need:

         


        
相关标签:
1条回答
  • 2021-01-29 12:52

    A command line tool like sed (How to replace space with comma using sed?) seems more suitable for this job. If you really want to to this in R, you could use e.g. yourData <- readLines(...) and gsub(");",");\n",yourData)

    0 讨论(0)
提交回复
热议问题