[R] time when packages installed

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Apr 27 12:29:24 CEST 2014


On 27/04/2014 10:50, Duncan Murdoch wrote:
> On 27/04/2014, 4:14 AM, amarjit chandhial wrote:
>>
>>
>> Is there a way in R to list the packages I installed by date ?
>>
>> Or to list the packages I installed in the last n days ?
>>
>
> R doesn't record that itself, but your OS probably does.

It must do.  So see ?dir and ?file.info.  E.g.

pkgs <- dir(.libPaths(), full.names = TRUE)
finf <- file.info(pkgs)
finf[difftime(Sys.time(), finf[,"mtime"], units = "days") <= 2 , 4, 
drop=FALSE]

shows all those up to 2 days old.


-- 
Brian D. Ripley,                  ripley at 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




More information about the R-help mailing list