How to deal with a 50GB large csv file in r language?

后端 未结 2 494
滥情空心
滥情空心 2021-02-03 13:45

I am relatively new in the \"large data process\" in r here, hope to look for some advise about how to deal with 50 GB csv file. The current problem is following:

Table

2条回答
  •  一向
    一向 (楼主)
    2021-02-03 14:26

    You can use R with SQLite behind the curtains with the sqldf package. You'd use the read.csv.sql function in the sqldf package and then you can query the data however you want to obtain the smaller data frame.

    The example from the docs:

    library(sqldf)
    
    iris2 <- read.csv.sql("iris.csv", 
        sql = "select * from file where Species = 'setosa' ")
    

    I've used this library on VERY large CSV files with good results.

提交回复
热议问题