0

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.

zx8754
  • 52,746
  • 12
  • 114
  • 209
user40780
  • 1,828
  • 7
  • 29
  • 50
  • "installation of package 'Hmisc' had non-zero exit status" means that Hmisc did not install properly. Try just `install.packages("Hmisc")` and take note of the complete error message. Also: users on this forum seem to have nothing but problems using Anaconda R, I suggest you don't use it. – neilfws Mar 22 '18 at 23:56
  • @neilfws, I edited the question. Please see if it may help... – user40780 Mar 23 '18 at 00:10
  • I'm surprised that there is not more information in the warning messages. And the error about CRAN simply would not occur using a standard R + RStudio installation, so I remain suspicious of Anaconda. – neilfws Mar 23 '18 at 00:15
  • Does this answer your question? [How to install "Hmisc" in R](https://stackoverflow.com/questions/52902174/how-to-install-hmisc-in-r) – Stef Jan 12 '23 at 20:53

2 Answers2

1

I had a similar issue, solved it by installing "acepack" directly install.packages('acepack')

Dominik Lenda
  • 41
  • 1
  • 8
0

This is mysterious, regardless. I do an update of all packages in Conda. Then, I install Rstudio using anaconda. Then the error does not exist anymore...

user40780
  • 1,828
  • 7
  • 29
  • 50