Error in library("Hmisc"): there is no package called 'Hmisc'

时间:2018-03-22 23:50:48

标签: r

I just installed R using anaconda, and I am following this tutorial:

https://www.analyticsvidhya.com/blog/2016/03/tutorial-powerful-packages-imputing-missing-values/

I learned that I need to install some package by using:

if(!require(Hmisc)) install.packages("Hmisc",repos = "http://cran.us.r-project.org")

There are some warning message i am not sure whether it means successful or not:

Loading required package: Hmisc
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called 'Hmisc'also installing the dependencies 'survival', 'ggplot2'

Warning message:
In install.packages("Hmisc", repos = "http://cran.us.r-project.org"): installation of package 'survival' had non-zero exit status
Warning message:
In install.packages("Hmisc", repos = "http://cran.us.r-project.org"): installation of package 'ggplot2' had non-zero exit status
Warning message:
In install.packages("Hmisc", repos = "http://cran.us.r-project.org"): installation of package 'Hmisc' had non-zero exit status

The downloaded source packages are in
    '/tmp/Rtmpcf6rZ9/downloaded_packages'
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

Then I tried to load the library with

library(Hmisc)

But I got the error,

Error in library(Hmisc): there is no package called 'Hmisc'

Does anyone know what might has happened? Thanks.

Edit:

I am suggested to try a few more ways, but they all have various error:

install.packages("Hmisc")
Error in contrib.url(repos, type): trying to use CRAN without setting a mirror

If I do:

install.packages("Hmisc",repos = "http://cran.us.r-project.org")

I got: also installing the dependencies 'survival', 'ggplot2'

Warning message:
In install.packages("Hmisc", repos = "http://cran.us.r-project.org"): installation of package 'survival' had non-zero exit status
Warning message:
In install.packages("Hmisc", repos = "http://cran.us.r-project.org"): installation of package 'ggplot2' had non-zero exit status
Warning message:
In install.packages("Hmisc", repos = "http://cran.us.r-project.org"): installation of package 'Hmisc' had non-zero exit status

The downloaded source packages are in
    '/tmp/Rtmpcf6rZ9/downloaded_packages'
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

I am suggested not to use Anaconda R, but because I mostly use rpy2 and jupiter notebook the most. I think using the Anaconda R may be the most straight forward method to get my jupiter notebook and python to work seamlessly with R.

3 个答案:

答案 0 :(得分:1)

我有一个类似的问题,可以通过直接安装“ acepack” install.packages('acepack')

来解决。

答案 1 :(得分:0)

无论如何,这都是神秘的。我对Conda中的所有软件包进行了更新。然后,我使用anaconda安装Rstudio。然后错误不再存在......

答案 2 :(得分:-1)

第一步:install.packages('acepack')

第 2 步:使用以下命令安装:install.packages("Hmisc")

相关问题