Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note: zip::zip() is deprecated, please use zip::zipr() instead #454

Open
SteadyGiant opened this issue Mar 12, 2019 · 16 comments · May be fixed by #457
Open

Note: zip::zip() is deprecated, please use zip::zipr() instead #454

SteadyGiant opened this issue Mar 12, 2019 · 16 comments · May be fixed by #457

Comments

@SteadyGiant
Copy link

Just a heads up in case this affects anything. The zip package pushed an update sometime in the last 24 hours, and now openxlsx::saveWorkbook() returns this note:

Note: zip::zip() is deprecated, please use zip::zipr() instead

  • Version of openxlsx: 4.1.0
  • Version of zip: 2.0.1
  • Version of R: 3.5.2 (Windows)
@md0u80c9
Copy link

I've just tested on a local copy.

Literally a one-character change in the source code (zip::zip to zip::zipr on line 544 of WorkbookClass.R) appears to work fine subsequently.

@awalker89 is there any chance of a quick fix release for this being dropped to CRAN to avoid the deprecation notices?

@yanlesin yanlesin linked a pull request Mar 20, 2019 that will close this issue
@davidgohel
Copy link

Hi all,

I am curious, I tried this solution on my side (with another package named officer) and it did not worked. Then I tried the PR of yanlesin (I thought I did a mistake and could reuse this solution) but got unvalid files also.

@md0u80c9 Did you tried this solution and it worked (then I have an issue) or did you just supposed it should work (then I think it does not solved the issue and this package and mine have the same issue with package zip)

@md0u80c9
Copy link

I literally changed the function, rebuilt the package and it worked with the examples I threw at it without any problem (and the warning has gone).

Of course that doesn't mean that there isn't a problem and I just haven't triggered it!

@davidgohel
Copy link

thanks @md0u80c9 then I may have a local issue as on my mac, xlsx generated by this method are invalids (pptx or docx from officer as well). Sorry for disturbing :)

@md0u80c9
Copy link

No worries at all! Let me know how you get on! Did you try the rebuild of this package with the change to see what happens?

@davidgohel
Copy link

davidgohel commented Mar 29, 2019

yes,

After rebuilding the package I got the following file (with R command openxlsx::write.xlsx(iris, file = "coco.xlsx")) and it is invalid

toto.xlsx

@pieterov
Copy link

pieterov commented Apr 6, 2019

Hi @davidgohel - I am using officer (version 0.3.3) and I love it. My company is ruled by ppt, so the opportunity to automatically print R output to ppt slides is saving me a lot of time. I used reporter before. Thank you for the efforts developing and supporting these packages!

In context of the thread above, when printing a ppt file using the following code:

print(x = ppt.file, target = paste0(path.deliverables, " - Batch Analysis.pptx"))

I get the message, "Note: zip::zip() is deprecated, please use zip::zipr() instead"

The ppt file is saved and I can open it. So, no critical issue. However, would be great to have it resolved. Will the officer package be updated? Or is there something else I can do to resolve the message?

Thanks!

====================
Further, I have installed R 3.5.3 and R Studio 1.1.463. The object 'ppt.file' is constructed with help of officer functions, including 'add_slide', 'ph_with_text', and 'ph_with_gg'.

@nitika-goel
Copy link

@md0u80c9 , I am facing the same issue. I am new to R and do not know how to rebuild packages from source code. Can you help me with the rebuilt package that works for you?

@Hugovdberg
Copy link

I guess the problem is that zip and zipr assume a different root directory for the files, see the section on relative paths in the documentation. The working directory should therefore be changed as well on line 542.

@JulianGaviriaL
Copy link

It is a pitty, I still get the same problem as well. Has anyone a clear idea about how to solv this issue?
P.D. The problem raises when I specify a directory path.

@JulianGaviriaL
Copy link

Hi again,

I just realized that my path is too large. Sorry for the inconvenience, the latest version (4.1.0.1) works fine.
Thanks for developing such an efficient package.

@facorread
Copy link

facorread commented Jul 11, 2019

The master branch continues to use zip::zip(); I would suggest to reopen this issue.

Any plans to accept the proposed PR #457?

library(openxlsx)
cat("openxlsx version", as.character(packageVersion("openxlsx")), "\n", R.Version()$version.string, "\n")
data <- data.frame(c(1,2), c("a", "b"))
write.xlsx(data, "test.xlsx")

Output:

openxlsx version 4.1.0.1 
 R version 3.6.1 (2019-07-05) 
Note: zip::zip() is deprecated, please use zip::zipr() instead

@MattCowgill
Copy link

It'd be great if PR #457 could be accepted!

@ammari1986
Copy link

Try first to define your work directory by :
setwd("~/filea/fileb")
then:
library(openxlsx)
and you will not get this problem of: "Note: zip::zip() is deprecated, please use zip::zipr() instead" when you will use :
write.xlsx

david-f1976 pushed a commit to david-f1976/openxlsx that referenced this issue Nov 8, 2019
@ycphs
Copy link
Contributor

ycphs commented Nov 15, 2019

Hi,

That is the old repository for this R Package.

Please use the new one:

https://github.com/ycphs/openxlsx

@JulianGaviriaL
Copy link

JulianGaviriaL commented Nov 15, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.