1

I'm new to code on R. I've got a big document feature matrix(11mln*500000) which I need to save somehow to file which can be later read using not R. Trying to do this:

data<-readRDS("dfm")
new_data<-head(data, 11156133, 517888)
df<-as.data.frame(new_data)
write.csv(df, "dfm.csv")

But get an error:

Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 105

Please help

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
Anastasia
  • 26
  • 1
  • 7
  • 2
    If you can't save the entire thing in one go, save it by let's say 1000 lines each time (append to file). – rbm Mar 02 '17 at 11:14

1 Answers1

1

Install and load the data.table package, and try the fwrite function.

sanyi14ka
  • 809
  • 9
  • 14