下载MODIS包出现上述错误后改用下述语句:

> install.packages("MODIS", repos='https://mran.microsoft/snapshot/2019-02-01/')

RStudio给出提示,下了好大一阵最后失败:
also installing the dependencies ‘gdtools’, ‘BH’, ‘markdown’, ‘satellite’, ‘svglite’, ‘uuid’, ‘webshot’, ‘leaflet’, ‘leaflet.extras’, ‘mapview’, ‘miniUI’, ‘classInt’, ‘units’, ‘mapdata’, ‘raster’, ‘mapedit’, ‘ptw’, ‘rgdal’, ‘rgeos’, ‘sf’

再该用R重复执行,下载好一阵还剩一个sf,只好重新执行

install.packages("sf", repos='https://mran.microsoft/snapshot/2019-02-01/')下载sf包。再执行

> install.packages('MODIS')
Warning: 无法在貯藏處http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.6中读写索引:
  无法打开URL'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.6/PACKAGES'
Warning message:
package ‘MODIS’ is not available (for R version 3.6.3) 

再执行install.packages("MODIS", repos='https://mran.microsoft/snapshot/2019-02-01/')

成功了!

总结:设置R的国内镜像时下载速度很快,但如有些包下载不了可以改用install.packages("xx", repos='https://mran.microsoft/snapshot/2019-02-01/')。此时网速可能很慢,要用R而不是RStudio,如中途失败还需要反复下载才能成功。

 

更多推荐

R语言解决package ‘MODIS’ is not available (for R version 3.6.3) 的问题