Reading Tab Delimited Data in to R

前端 未结 2 1706
梦谈多话
梦谈多话 2021-01-04 02:32

I am trying to read a large tab delimited file in to R.

First I tried this:

data <- read.table(\"data.csv\", sep=\"\\t\")

But it

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-04 03:17

    x <- paste("'",floor(runif(10,0,10)),"'",sep="")
    x
    
     [1] "'7'" "'3'" "'0'" "'3'" "'9'" "'1'" "'4'" "'8'" "'5'" "'8'"
    
    as.numeric(gsub("'", "",x))
    
     [1] 7 3 0 3 9 1 4 8 5 8
    

提交回复
热议问题