marie
marie

Reputation: 223

abstracting data from huge file and exporting this data in excel

I have a huge data file with genotypic data. I want to extract certain data and export this data in excel at once. When I am running the code for abstracting the data, R wants to put this data in the Console window and I am then getting error messages that there is not enough memory space. Is there a way to tell R, not to put the extracted data in the Console window but export it instead in an excel file?

The code for abstracting the desired data is

subset(project, grepl("^UEBB018.*", pedigree_dhl) )

Upvotes: 0

Views: 188

Answers (1)

IRTFM
IRTFM

Reputation: 263311

This is a follow-up to @joran's comment:

 subfile <- subset(project, grepl("^UEBB018.*", pedigree_dhl) )
 write.csv(subfile, file="outUEBB018.csv")

My memory is that you need to do this in two steps because the first argument to write.csv is not evaluated, but my memory on such details is not great. (I use the help files a lot.) Ben's comment below is correct. You can do it in one step.

Upvotes: 2

Related Questions