Multiple Separators for the same file input R

后端 未结 3 1162
一个人的身影
一个人的身影 2020-12-30 08:17

I\'ve had a look for answers, but have only found things referring to C or C#. I realise that much of R is written in C but my knowledge of it is non-existent. I am also re

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 08:32

    library(stringr)
    
    results <- read.delim("~/results", header=F)
    results <- cbind(results,str_split_fixed(results$V3, "[_-]", 9))
    

    (this assumes you're OK with having the original column still in place)

提交回复
热议问题