At first, I tried to read and write xlsx files in R (while comparing the output between the xlsx
and openxlsx
packages).
I work on mac os.
It worked well to read xlsx files using the read.xlsx()
from both packages.
However, when it comes to writing a new file, only the xlsx::write.xlsx()
worked.
To be more exact, the openxlsx::write.xlsx()
command gave no error, and an xlsx file was successfully saved, but when I tried to open the file using Numbers (by double clicking on the file in the folder), an error message popped up telling me the file cannot be opened.
I tried different data frames, but the results remained the same. To show an example, please refer to the following line which I took directly from R help page. It should work but does not work for me.
write.xlsx(iris, file = "writeXLSX1.xlsx", colNames = TRUE, borders = "columns")
Anyone tell me what the problem is? I tried to google for old threads but it seems no one is discussing this problem. I know in many similar threads people suggested changing packages, okay...before that, can you tell me what the limitations of openxlsx
are?
openxlsx_4.0.17
onR 3.4.0
– Mattias