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.

TongZZZ
  • 756
  • 2
  • 8
  • 20
  • What do you have when you type `system( "zip -@ -6 C:\\Users\\R.wd\\ff\\ffd")`? – agstudy Feb 20 '13 at 04:25
  • 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. –  Feb 20 '13 at 09:04
  • > system( "zip -@ -6 C:\\Users\\R.wd\\ff\\ffd") then no output, nothing happened, goes to next prompt line – TongZZZ Feb 20 '13 at 15:08
  • 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. – TongZZZ Feb 20 '13 at 15:16
  • To set the path see here: http://www.computerhope.com/issues/ch000549.htm#0 – Jase Aug 30 '13 at 11:49

3 Answers3

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.

Anurag Tripathi
  • 1,208
  • 1
  • 12
  • 31
  • 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 ? – Qbik Jan 29 '15 at 22:21
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.
Raja
  • 994
  • 13
  • 15
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.