3
votes

I have a matrix with 168 rows and about 6000 columns. The column names are stock identifiers, the rownames are dates. I would like to export this matrix as a .csv file. I tried the following:

write.csv(OAS_data, "Some Path")

The export works. But the header of the matrix (stock identifiers) is distributed over the first 3 rows of the .csv file (when opened in excel). The first two rows each contain the names of 2184 column names. The rest of the column names is in the third line. How can I avoid those breaks? The rest of the .csv file looks fine - no line breaks there.

Thank You.

1
From Microsoft Office support....In Excel 2010, the maximum worksheet size is 1048576 rows by 16384 columns. This is an excel problem, not an R problem. Why take it out of R in the first place?Mike.Gahan

1 Answers

5
votes

Your best bet is probably to transpose your data and analyze it that way due to Excel's limits.

write.csv(t(OAS_data), "Some Path")