Saving a data frame as a binary file

后端 未结 2 1653
自闭症患者
自闭症患者 2020-12-15 08:30

I would like to save a whole bunch of relatively large data frames while minimizing the space that the files take up. When opening the files, I need to be able to control wh

2条回答
  •  清歌不尽
    2020-12-15 09:05

    You may have a look at saveRDS and readRDS. They are functions for serialization.

    x = data.frame(x1=runif(10), x2=runif(10), x3=runif(10))
    
    saveRDS(x, file="myDataFile.rds")
    x <- readRDS(file="myDataFile.rds")
    

提交回复
热议问题