简体   繁体   中英

Error when exporting R data frame using openxlsx ("Error in zipr")

Usually I'm using the openxlsx package and the write.xlsx function when exporting R data frames into .xlsx-files. Since yesterday - probably after I was using the package XLConnect - something got messed up and the write.xlsx function doesn't work anymore. This is the error I get:

Error in zipr(zipfile = tmpFile, include_directories = FALSE, files = list.files(path = tmpDir, : unused argument (include_directories = FALSE)

Unfortunately, I don't understand what this error means. Thanks for any helpful advice.

Edit: The function works when I use an older openxlsx version (4.1.0).

I was getting the same error.

I think the problem is with dependencies of openxlsx. There is a "zipR" package that might be picked up when you install openxlsx, while the actual dependency is zip package:

I installed "zip" along with openxlsx and I don't get the error anymore.

I do not really understand the error message here. My computer does not allow me to save files to "c:/". So, if remove "c:/" part, it works fine, to save the file to the current working directory.

library(openxlsx)
df <- data.frame('x' = c(1,2,3),
                 'y' = c(3,2,1))
openxlsx::write.xlsx(df, "test.xlsx")

You would also try another package: writexl

writexl::write_xlsx(df, "text5.xlsx")`

This works on my machine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM