Rstudio安装数据包CASdatasets

文章讲述了在R4.2.2版本中尝试安装CASdatasets包的过程。作者首先成功通过手动下载并安装了包,然后尝试通过不同的repositories安装但都遇到了问题,包括下载大小不匹配、超时和无法找到适合R版本的包。最后,作者提到在GitHub上安装也失败了。
摘要由CSDN通过智能技术生成

先说最有可能成功的一种吧
先安装下面几个包,载入

library(zoo)
library(xts)
library(lattice)
library(sp)

去下面这个网站下载
http://cas.uqam.ca/pub/src/contrib/CASdatasets_1.0-11.tar.gz
下载完以后手动安装
在这里插入图片描述
选择Install from Package Archive File
Browse选择前面下载的包的地址
在这里插入图片描述
下附上成功安装导入代码

> install.packages("D:/software/R-4.2.2/library/CASdatasets_1.0-11.tar.gz", repos = NULL, type = "source")
* installing *source* package 'CASdatasets' ...
** using staged installation
** data
** inst
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (CASdatasets)
> library(CASdatasets)
> > data(lossalae)
> head(lossalae)
  Loss ALAE
1   10 3806
2   24 5658
3   45  321
4   51  305
5   60  758
6   74 8768

其他几种方法——未成功

#一
install.packages("CASdatasets", repos = "http://cas.uqam.ca/pub/", type="source")
#二
install.packages("CASdatasets", repos = "http://dutangc.perso.math.cnrs.fr/RRepository/", type="source")
#三
install.packages("CASdatasets", repos = "http://dutangc.free.fr/pub/RRepos/", type="source")
#四
install.packages("devtools")
devtools::install_github("dutangc/CASdatasets", subdir="pkg")

都没成功

> install.packages("CASdatasets", repos = "http://cas.uqam.ca/pub/", type="source")
trying URL 'http://cas.uqam.ca/pub/src/contrib/CASdatasets_1.0-11.tar.gz'
Content type 'application/x-gzip' length 119516409 bytes (114.0 MB)
downloaded 148 KB

Warning in install.packages :
  downloaded length 152373 != reported length 119516409
Warning in install.packages :
  URL 'http://cas.uqam.ca/pub/src/contrib/CASdatasets_1.0-11.tar.gz': Timeout of 60 seconds was reached
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'http://cas.uqam.ca/pub/src/contrib/CASdatasets_1.0-11.tar.gz' failed
Warning in install.packages :
  下载程序包‘CASdatasets’时出了问题
> install.packages("CASdatasets", repos = "http://dutangc.perso.math.cnrs.fr/RRepository/", type="source")
Warning in install.packages :
  无法在貯藏處http://dutangc.perso.math.cnrs.fr/RRepository/src/contrib中读写索引:
  cannot open URL 'http://dutangc.perso.math.cnrs.fr/RRepository/src/contrib/PACKAGES'
Warning in install.packages :
  package ‘CASdatasets’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
> devtools::install_github("dutangc/CASdatasets", subdir="pkg")
Downloading GitHub repo dutangc/CASdatasets@HEAD
Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
  download from 'https://api.github.com/repos/dutangc/CASdatasets/tarball/HEAD' failed

我的r版本是4.2.2,如有人使用上述链接安装成功欢迎评论区指正。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值