R· install packages: unable to access index

> install.packages("mediation")
Warning in install.packages :
  unable to access index for repository https://mirrors.tongji.edu.cn/CRAN/src/contrib:
  cannot open URL 'https://mirrors.tongji.edu.cn/CRAN/src/contrib/PACKAGES'
Warning in install.packages :
  unable to access index for repository https://mirrors.tongji.edu.cn/CRAN/src/contrib:
  cannot open URL 'https://mirrors.tongji.edu.cn/CRAN/src/contrib/PACKAGES'
Warning in install.packages :
  package ‘mediation’ 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
Warning in install.packages :
  unable to access index for repository https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/4.1:
  cannot open URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/4.1/PACKAGES'

1. wifi信号差,改手机热点

2. 改R studio设置: Tools -> Global Options -> Packages

多试几个 

→成功:

> install.packages("mediation")
还安装相依关系‘lpSolve’

trying URL 'https://mirrors.bfsu.edu.cn/CRAN/bin/windows/contrib/4.1/lpSolve_5.6.15.zip'
Content type 'application/zip' length 698395 bytes (682 KB)
downloaded 682 KB

trying URL 'https://mirrors.bfsu.edu.cn/CRAN/bin/windows/contrib/4.1/mediation_4.5.0.zip'
Content type 'application/zip' length 1289659 bytes (1.2 MB)
downloaded 1.2 MB

package ‘lpSolve’ successfully unpacked and MD5 sums checked
package ‘mediation’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\19535\AppData\Local\Temp\Rtmp0AwzsY\downloaded_packages
> library(mediation)
载入需要的程辑包:Matrix
载入需要的程辑包:mvtnorm
载入需要的程辑包:sandwich
mediation: Causal Mediation Analysis
Version: 4.5.0

Warning messages:
1: 程辑包‘mediation’是用R版本4.1.2 来建造的 
2: 程辑包‘Matrix’是用R版本4.1.1 来建造的 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值