[R] reinstall all packages - easy way?

Rainer M Krug Rainer at krugs.de
Thu Jan 9 10:47:10 CET 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 01/09/14, 10:35 , Berwin A Turlach wrote:
> G'day Rainer,

Hi Berwin,

> 
> On Thu, 09 Jan 2014 10:10:43 +0100 Rainer M Krug <Rainer at krugs.de>
> wrote:
> 
>> is there an easy way of re-installing all packages in my user
>> library? I am not referring to checkBuilt=TRUE, but re-install
>> all packages, irrespective of the version.
> 
> Something like:
> 
> R> ip <- installed.packages() R> colnames(ip) [1] "Package"
> "LibPath" [3] "Version"               "Priority" [5] "Depends"
> "Imports" [7] "LinkingTo"             "Suggests" [9] "Enhances"
> "License" [11] "License_is_FOSS"       "License_restricts_use" [13]
> "OS_type"               "MD5sum" [15] "NeedsCompilation"
> "Built" R> unique(ip[,"Priority"]) [1] NA            "recommended"
> "base" R> install.packages(ip[is.na(ip[,"Priority"]), "Package"])
> 
> perhaps?
> 
> The last command is, obviously, not tested.  This supposes that you
> do not want to reinstall the "recommended" or "base" packages
> (probably best to just use "update.packages()" to update those).

Yes - I only want to re-install the user installed packages, which are
in .libPaths()[1] in my case, so I did:

ip <- installed.packages(lib.loc=.libPaths()[1])
install.packages(ip["Package"], type="source")

and off I go. Installing them at the moment.

It just would be nice to have an argument in update.packages() like
reinstallAll=FALSE which, if set to TRUE, would reinstall all
installed packages in the lib.loc.

Thanks,

Rainer

> 
> Best wishes,
> 
> Berwin
> 
> ========================== Full address
> ============================ A/Prof Berwin A Turlach
> Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M019)
> +61 (8) 6488 3383 (self) The University of Western Australia   FAX
> : +61 (8) 6488 1028 35 Stirling Highway Crawley WA 6009
> e-mail: Berwin.Turlach at gmail.com Australia
> http://www.maths.uwa.edu.au/~berwin 
> http://www.researcherid.com/rid/A-4995-2008
> 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSznAeAAoJENvXNx4PUvmC2bYIAJOiKGvSZsvFL05/MewA/Xie
mzcm0wcl7ZXMzNyzV2sUXFcI/V8CUly57dqaORYtgIO8L6wi0JdHP90vegPVUsn1
uRQ+eswWNnuQ5Dy/KVfylJg5vJV+6xW6ivSFlDX5XRmhn9RXfb1T6hwX5IuoeufV
OdJW/h5b66QLgOZC28QWnx0UIxWbWYEg7BHT3wFFwViZ/lKQ3+S0JoXulULfxQZ0
4bTZcfI2IflrXJ7tN4dL/jISiJreaIxI4WUMgBoZ6cjvXhI/uQPVGXSfhTGs22TU
UWXEtfVm0ZWYvF8BAsYqrPmffOUc64nFXFavHIaZAGoHvVfXBvB8wrEviQ5j3a8=
=fD0/
-----END PGP SIGNATURE-----




More information about the R-help mailing list