简体   繁体   中英

R write_ods function send back status 127

I try to write ods file using R , with the readODS package. It is working fine on a computer, on another, with the same code, I get :

Warning message:
running command '"zip" -r9X "test.ods" "content.xml" "META-INF" "meta.xml" "mimetype" "styles.xml" ' had status 127

My code is :

library(readODS)
write_ods(cars,path)

What should I do ? I figure I have to install a zip command, but what is this ?

I had the same error with the readODS::write_ods() function.
It came from the fact that zip command was not recognized on my system.
First of all, here is my sessionInfo() :

R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

I solved this error installing Rtools on my computer: check if Rtools is installed. If not, you can download it here : https://cran.r-project.org/bin/windows/Rtools/
In my case, Rtools is installed in C:\\RBuildTools\\3.4\\ . In this directory, one can find a bin subdirectory with zip.exe inside. Finally, I added C:\\RBuildTools\\3.4\\bin\\ to the PATH environment variable, and readODS::write_ods() works fine !

I hope that it will help you.

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