Hola! I am writing a package with some large data files, so it would be good to use the feature of zipping data. However, I use .R files to read in the data from one (sometimes more) files, so Rcmd build --zip-data gives a package which does'nt work. How should I do it, is it better ti zip each data file individually and use the functions to read from zipped files, or are there some other solution? Did'nt find anything in "Writing R extensions". Kjetil
Hi Kjetil!
I would pack the files, as you said, and use functions to read from zipped
files.
You can place the data file in the directory e.g inst/mydata.
See (writing R extension to know more about the inst directory)
After installing the package you can get the path to the mydata direcotry using
the function ?system.file
dir<-system.file("mydata",package="mypackage")
Eryk
*********** REPLY SEPARATOR ***********
On 8/27/2004 at 11:39 AM Kjetil Brinchmann Halvorsen wrote:
>>>Hola!
>>>
>>>I am writing a package with some large data files, so it would be
good to
>>>use the feature of zipping data.
>>>
>>>However, I use .R files to read in the data from one (sometimes
more)
>>>files, so Rcmd build --zip-data
>>>gives a package which does'nt work. How should I do it, is it
better ti
>>>zip each data file individually and use the functions to read from
>>>zipped files, or are there some other solution?
>>>Did'nt find anything in "Writing R extensions".
>>>
>>>Kjetil
>>>
>>>______________________________________________
>>>R-devel@stat.math.ethz.ch mailing list
>>>https://stat.ethz.ch/mailman/listinfo/r-devel
Dipl. bio-chem. Eryk Witold Wolski @ MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin 'v'
tel: 0049-30-83875219 / \
mail: wolski@molgen.mpg.de ---W-W---- http://www.molgen.mpg.de/~wolski
On Fri, 27 Aug 2004, Kjetil Brinchmann Halvorsen wrote:> Hola! > > I am writing a package with some large data files, so it would be good to > use the feature of zipping data. > > However, I use .R files to read in the data from one (sometimes more) > files, so Rcmd build --zip-dataI think you mean Rcmd INSTALL here: build --binary is just a wrapper ^^^^^^^^> gives a package which does'nt work. How should I do it, is it better ti > zip each data file individually and use the functions to read from > zipped files, or are there some other solution? > Did'nt find anything in "Writing R extensions".Did you notice about .rda files? Writing compressed .rda files is the best way to provide large datasets. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595