R ff package ffsave 'zip' not found
Asked Answered
M

3

7

Reproduceable Example:

library("ff")
m <- matrix(1:12, 3, 4, dimnames=list(c("r1","r2","r3"), c("m1","m2","m3","m4")))
v <- 1:3    
ffm <- as.ff(m)    
ffv <- as.ff(v)        
d <- data.frame(m, v)

ffd <- ffdf(ffm, v=ffv, row.names=row.names(ffm))

 ffsave(ffd,file="C:\\Users\\R.wd\\ff\\ffd")
 ## Error in system(cmd, input = filelist, intern = TRUE) : 'zip' not found

System: Windows 7 64bit, R 15.2 64bit

Rtools installed

zip 300xn-x64 and unzip 600xn folders set to windows Path already

cmd line working, type zip or unzip it shows function info

Need help! Any suggestion is appreciated.

Monovalent answered 20/2, 2013 at 3:49 Comment(5)
What do you have when you type system( "zip -@ -6 C:\\Users\\R.wd\\ff\\ffd")?Valency
What does zip --version give you at the command line? You need to put the path where zip.exe is found in your PATH to solve this.Shortcoming
> system( "zip -@ -6 C:\\Users\\R.wd\\ff\\ffd") then no output, nothing happened, goes to next prompt lineMonovalent
ok, maybe I got the answer. This morning, I tried zip --version again, and unlike last night, this morning goes 'zip' is not recognized as an internal or external command. So I go and add set PATH=%PATH%; C:\Users\Desktop\zip300xn-x64; again, but this time, no effect. "zip" is still not recognized in cmd. I am using my work laptop, so I think this is the reason, maybe admin changed my computer, I was working at home last night using my home wifi, and I was able to add dir to path var. Now it seems I can't.Monovalent
To set the path see here: computerhope.com/issues/ch000549.htm#0Incept
N
1

It seems your path is not set for Zip, set path in environment variables. If you don't want to set path for all process you can do it for single command line session by SET command but then you have to start your R within same session.

Nga answered 6/9, 2013 at 12:4 Comment(1)
as I understand user have to add PATH to bin subfolder of Rtools folder, then write/read ffdf, then again change PATH to default value ?Metrology
U
1

Some of the links and downloads given in the documentation appears to be outdated. Here are the steps that are known to work on Windows 7, 64 bit: For ffsave and ffload to work correctly:

# Download zip 3.x and unzip 5.x. The correct URLs are:
# http://gnuwin32.sourceforge.net/packages/zip.htm
# http://gnuwin32.sourceforge.net/packages/unzip.htm
# Install both (they default to the same GnuWin32 directory). 
# Put the installation's \bin folder on the system PATH
# Restart R studio.
U answered 24/8, 2014 at 17:9 Comment(0)
W
1

The 'zip' not found issue is a problem not unique to the ff package. Here is a simple solution.

  1. Download Rtools https://cran.r-project.org/bin/windows/Rtools/
  2. Open Rtools and navigate to the bin folder. Rtools > bin
  3. In a separate window, open your r path. For example, mine is C:\Program Files\R\R-2.15.2\bin\x64 (more details at CRAN R for windows FAQ)
  4. Copy the the Rtools Application "zip" (from 2) into the r path folder (from 3)

Now you should be able to save your file. If you want to load your file you'll need to copy unzip into your r path folder as well.

Wilmerwilmette answered 25/7, 2015 at 0:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.