[R] creating a distinct zip file

Rolf Turner r.turner at auckland.ac.nz
Sat Feb 21 03:56:34 CET 2015


On 21/02/15 15:02, Jeff Newmiller wrote:
> R CMD INSTALL --build packagename

That will create a *.tar.gz file, not a *.zip file.  The latter being
what Erin wanted, if I understand correctly.

I have worked around the problem in the past with a shell script
like unto:

#! /bin/csh
set vnum = `grep Version $pkge/DESCRIPTION | sed -e 's/Version: //'`
R CMD INSTALL -l Lib $pkge >& /dev/null
cd Lib
zip -r -l $pkge.zip $pkge >& /dev/null
mv $pkge.zip ../$pkge"_"$vnum.zip

In the foregoing "pkge" is the name of the package you are trying to 
build.  You will have to have created the "holding library" "Lib" a priori.

There are doubtless (much) better ways of accomplishing this task, but I 
don't know them.

cheers,

Rolf

> ---------------------------------------------------------------------------
> Jeff Newmiller                        The     .....       .....  Go Live...
> DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
>                                        Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
> ---------------------------------------------------------------------------
> Sent from my phone. Please excuse my brevity.
>
> On February 20, 2015 1:07:10 PM PST, Erin Hodgess <erinm.hodgess at gmail.com> wrote:
>> Hello yet again.
>>
>> I am trying to create a zip file for a friend who has a Windows
>> machine.
>>
>> He needs to access this via the "local zip file" packages option.
>>
>> When I use R CMD INSTALL --compile-both, it produces an item in the
>> library
>> tree (as promised).
>>
>> However, I would like to have an actual .zip file.
>>
>> I do know at one time that was possible, not sure if I can still do it.
>>
>> I did try R CMD INSTALL --force-biarch as well, same result as compile
>> both.
>>
>> thank you for any suggestions.
>>
>> Sincerely,
>> Erin
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Rolf Turner
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276
Home phone: +64-9-480-4619



More information about the R-help mailing list