【R包安装问题】如何判断是否需要安装特定的R包?R包安装失败怎么办?

本人在尝试复制经济学文献的回归过程,已经下载了如下文件:

img

作者附有说明文件,里面关于R的系统说明内容有:

img

img

img


想问一下我是否需要把他列出的所有packages都安装一遍,才可能复制出结果?这个工作量可太大了

但我在安装other attached packages列表下的第一个包 texPreview_1.4.3 时就遇到问题,先是不支持R3.5.2(这是原作者所用的版本),后来本地安装包又提示一堆相关包需要安装,其中有三个包'knitr', 'lifecycle', 'rematch2' 没法正常通过install.packages安装。这种情况应该如何才能安装上这三个包呢?

> install.packages("C:/Users/QZY/Desktop/texPreview_1.4.3.tar.gz", repos = NULL, type = "source")
Installing package into ‘C:/Users/QZY/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
ERROR: dependencies 'knitr', 'lifecycle', 'rematch2' are not available for package 'texPreview'
* removing 'C:/Users/QZY/Documents/R/win-library/3.5/texPreview'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘C:/Users/QZY/Desktop/texPreview_1.4.3.tar.gz’ had non-zero exit status
> install.packages("knitr", repos = "    https://yihui.org/knitr/")
Installing package into ‘C:/Users/QZY/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
  unable to access index for repository     https://yihui.org/knitr/src/contrib:
  scheme not supported in URL '    https://yihui.org/knitr/src/contrib/PACKAGES'
Warning in install.packages :
  package ‘knitr’ is not available (for R version 3.5.2)
Warning in install.packages :
  unable to access index for repository     https://yihui.org/knitr/bin/windows/contrib/3.5:
  scheme not supported in URL '    https://yihui.org/knitr/bin/windows/contrib/3.5/PACKAGES'

感谢解答!!

你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。