How to check if a CRAN mirror is outdated?

别来无恙 提交于 2019-12-21 04:24:09

问题


R users are advised to download R and R packages from local CRAN mirrors. But some are outdated. Is there an easy way to check if a repository is outdated? Any function in R that does that?


回答1:


One way is to look at $CRANMIRROR/src/contrib and sort by date (by clicking twice on date) so that you can compare the most recent package on the mirror on what the master host carries.

Beyond that, you could use R itself and point available.packages() at the master as well as at a mirror -- if the result sets are different there may be an issue (or you hit the point between master update and mirroring).

Here is a quick example:

> main <- available.packages("http://cran.r-project.org/src/contrib", 
+                            method="wget")
> usmirror <- available.packages("http://cran.us.r-project.org/src/contrib", 
+                                method="wget")
> nrow(main)
[1] 2381
> nrow(usmirror)                 ## so the US mirror is 2 packages behind
[1] 2379
> setdiff(rownames(main), rownames(usmirror))    
[1] "ProbForecastGOP" "semPLS"   ## and these are the two
> 


来源:https://stackoverflow.com/questions/2954638/how-to-check-if-a-cran-mirror-is-outdated

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!