我如何安装此包“ JohnsonD​​istribution”

时间:2019-03-18 17:53:45

标签: r package

我正在尝试在R中安装此已删除的软件包,但不能。有想法吗?

https://cran.r-project.org/web/packages/JohnsonDistribution/index.html

下一个我使用的代码:

install.packages("~/R/win-library/3.5/johnson.zip", repos = NULL, type = "source")

错误:

 Warning in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
  cannot open compressed file 'johnson/DESCRIPTION', probable reason 'No such file or directory'Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :  no se puede abrir la conexión
In R CMD INSTALL 
Warning in install.packages :
  installation of package ‘C:/Users/Angel/Documents/R/win-library/3.5/johnson.zip’ had non-zero exit status

谢谢

PD:我不是在问如何以其他方式安装,而是在问如何安装此特定软件包,从而给我一个错误

2 个答案:

答案 0 :(得分:1)

使用提供的URL,您可以直接通过以下方式安装:

f

应该发生以下情况

install.packages("https://cran.r-project.org/src/contrib/Archive/JohnsonDistribution/JohnsonDistribution_0.24.tar.gz", 
             repos = NULL)

答案 1 :(得分:0)

ZIP不是标准的软件包格式。使用CRAN上可用的压缩包(* .tar.gz):

https://cran.r-project.org/src/contrib/Archive/JohnsonDistribution/JohnsonDistribution_0.24.tar.gz

path_to_file = "https://cran.r-project.org/src/contrib/Archive/JohnsonDistribution/JohnsonDistribution_0.24.tar.gz"
install.packages(path_to_file, repos = NULL, type="source")

或者,如果您绝对需要使用该ZIP文件,则可以在R中重新打包,然后使用上面的命令安装生成的TAR:

unzip("~/R/win-library/3.5/johnson.zip")
shell("R CMD build johnson")