Home > Software design >  How to create a CSV-File for a dataframe with multiple lists in R?
How to create a CSV-File for a dataframe with multiple lists in R?

Time:12-14

As I'm dealing with a huge dataset I had to split my data into different buckets. Thus, I want to save some interim results in a csv to recall it later. However, my datafile contains some columns with lists, which according to R can not be exported (see snapshot). Do you guys know a simple way for a R newbie to make this work?

Thank you so much!

Snapshot of dataset

CodePudding user response:

I guess the best way to solve your problem is switching to a more apropriate file format. I recomend using write_rds() from the readr package, which creates .rds files. The files you create with readr::write_rds('your_file_path') can be read in with readr::read_rds('your_file_path').

The base R functions are saveRDS() and readRDS() and the functions mentioned earlier form the readr are just wrappers with some convience features.

CodePudding user response:

just right click then choose new csv to the folder where you want to save your work. then choose the seperator of the csv to ,

input all data in a column form, you can later make it a matrix in your R program.

  • Related