如何在47GB数据帧上运行?

时间:2017-03-29 14:03:04

标签: r

我认为R正在将所有内容加载到RAM中。如何获得权重超过47GB的data.frame? :o

我也可以将它与功能一起使用。怎么样?!

这就是我制作这个data.frame的方式:

set.seed(200) 
n <- 10000000
dt <- data.frame(default = as.logical(sample(x=c(F,T), size=n, replace=T,
                                             prob=c(.9,.1))),
                 f_prawna = as.factor(sample(x=c("SA","Sp. z o.o","OF",
                                                     "ROL", "inne",NA, 
                                                     "cywilna","kom",
                                                     "kom-akc","spol", "panst"
                 ), size=n, replace=T)),
                 branza = as.factor(sample(x=c("transp","bud","wolny","pref",
                                               "inny"), size=n, replace=T)),
                 asset = as.factor(sample(x=c("osd","miu","miu2","miu3",
                                              "truck"), size=n, replace=T)),
                 czy_uwaga = as.factor(sample(x=0:1, size=n, replace=T))

)

for (i in 1:8){
  dt <- cbind(dt,dt)
}

dim(dt)

证明:a picture

0 个答案:

没有答案