简体   繁体   English

为 Rstudio 安装 package rms 时遇到问题

[英]Trouble installing package rms for Rstudio

I have been having an issue installing package rms.我在安装 package rms 时遇到问题。 I am trying to interpret ordinal models (using the package ordinal) and plot regressions using them.我正在尝试使用它们来解释序数模型(使用 package 序数)和 plot 回归。 For rms, I don't even get an error, just that it updates other loaded packages, loads and attaches package 'lubridate' which had already been installed, and that 'date' is masked from the base package.对于 rms,我什至没有收到错误,只是它更新了其他加载的包,加载并附加了已经安装的 package 'lubridate',并且该“日期”从基础 package 中屏蔽。

For reference I had originally tried to install hmisc, which I found out was a dependency for rms.作为参考,我最初尝试安装 hmisc,我发现它是 rms 的依赖项。 This led to an issue installing dependency gfortran.这导致安装依赖项 gfortran 时出现问题。 When I attempt to install gfortran, I get当我尝试安装 gfortran 时,我得到

  package ‘gfortran’ is not available (for R version 3.5.1)

But then, when I try to install Hmisc, I get但是,当我尝试安装 Hmisc 时,我得到了

installing the source package ‘Hmisc’

trying URL 'https://cran.rstudio.com/src/contrib/Hmisc_4.4-0.tar.gz'
Content type 'application/x-gzip' length 744545 bytes (727 KB)
==================================================
downloaded 727 KB

* installing *source* package ‘Hmisc’ ...
** package ‘Hmisc’ successfully unpacked and MD5 sums checked
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c Hmisc.c -o Hmisc.o
gfortran   -fPIC  -g -O2  -c cidxcn.f -o cidxcn.o
make: gfortran: No such file or directory
make: *** [cidxcn.o] Error 1
ERROR: compilation failed for package ‘Hmisc’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Hmisc’
Warning in install.packages :
  installation of package ‘Hmisc’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/5l/r40ht3p511j0mbty0ptcc7zm0000gn/T/RtmpFAI0pw/downloaded_packages’

For reference, I run this on a Mac OS Catalina (10.15.4).作为参考,我在 Mac OS Catalina (10.15.4) 上运行它。

Alternatively, if you have any other ways to graph regressions using ordinal models please let me know.或者,如果您有任何其他方法可以使用序数模型绘制回归图,请告诉我。 Thank you very much.非常感谢。

I got a similar error even though I had installed gfortran by running brew install gfortran .即使我通过运行brew install gfortran安装了gfortran ,我也遇到了类似的错误。 But I needed to add this to my ~/.Rprofile :但我需要将此添加到我的~/.Rprofile

Sys.setenv(PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM