Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R ff package ffsave 'zip' not found

Tags:

r

bigdata

ffbase

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.

like image 739
TongZZZ Avatar asked Feb 20 '13 03:02

TongZZZ


3 Answers

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.

like image 120
Anurag Tripathi Avatar answered Nov 12 '22 02:11

Anurag Tripathi


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.
like image 28
Raja Avatar answered Nov 12 '22 02:11

Raja


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.

like image 45
GameChanger Avatar answered Nov 12 '22 02:11

GameChanger