


Many thanks Guys!


Amarjit


 

________________________________
 From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
To: amarjit chandhial <a.chandhial@btinternet.com>; "r-help@r-project.org" <r-help@r-project.org> 
Sent: Sunday, 27 April 2014, 11:29
Subject: Re: [R] time when packages installed
  

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@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
	[[alternative HTML version deleted]]


