views:

65

answers:

1

Hi all,

I am looking for a function that will tell me, for a list of packages, which of them is up to date and which is not (I need it so to trace back an R crash).

Thanks,

Tal

+8  A: 

Well, you could just update them with the update.packages() function.

You could use installed.packages() and available.packages() to find any differences. Just merge the two results together on the name, and then look for version differences.

i <- installed.packages()
a <- available.packages()
ia <- merge(i, a, by="Package")[,c("Package", "Version.x", "Version.y")]
ia[as.character(ia$Version.x) != as.character(ia$Version.y),]
Shane
This is most helpful - thank you very much Shane!
Tal Galili
And that 'comparison by sets' is basically what CRANberries does to compute new or changes packages.
Dirk Eddelbuettel