首页 > 解决方案 > 我如何安装这个包“JohnsonD​​istribution”

问题描述

我正在尝试在 R 中安装这个已删除的包,但我不能。任何想法?

https://cran.r-project.org/web/packages/JohnsonD​​istribution/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:我不是问我如何以其他方式安装,我问的是如何安装这个给我一个错误的特定包

标签: rpackage

解决方案


使用提供的 URL,您可以使用以下内容直接安装:

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

应该出现以下情况

> install.packages("https://cran.r-    project.org/src/contrib/Archive/JohnsonDistribution/JohnsonDistribution_0.24.tar.gz", 
+                  repos = NULL)
trying URL 'https://cran.r-    project.org/src/contrib/Archive/JohnsonDistribution/JohnsonDistribution_0.2    4.tar.gz'
Content type 'application/x-gzip' length 7744 bytes
==================================================
downloaded 7744 bytes

* installing *source* package ‘JohnsonDistribution’ ...
** package ‘JohnsonDistribution’ successfully unpacked and MD5 sums checked
** libs
gfortran   -fPIC  -g -O2  -c JohnsonCurve.f -o JohnsonCurve.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined     dynamic_lookup -single_module -multiply_defined suppress -    L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o     JohnsonDistribution.so JohnsonCurve.o -L/usr/local/gfortran/lib/gcc/x86_64-    apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -    F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -    Wl,CoreFoundation
ld: warning: directory not found for option '-    L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
installing to     /Library/Frameworks/R.framework/Versions/3.5/Resources/library/JohnsonDistribution/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (JohnsonDistribution)

推荐阅读