Error in library("Hmisc"): there is no package called 'Hmisc' - 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.

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

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...

Related

Could not install R package source in R-studio

I have a source of one R package (http://stat.snu.ac.kr/heeseok/autots). I would like to install it in R-studio, however, I got an error.
Here is my try:
install.packages("/Users/Mary/Downloads/autots_2.3.3.tar.gz", repos=NULL, type="source")
Here is the error:
ERROR: dependencies ‘fBasics’, ‘fNonlinear’, ‘fGarch’, ‘fUtilities’, ‘tsDyn’, ‘tseriesChaos’ are not available for package ‘autots’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/autots’
Warning in install.packages :
installation of package ‘/Users/Mary/Downloads/autots_2.3.3.tar.gz’ had non-zero exit status

Install Package in Jupyter Notebook, Anaconda

I'm running R language with Jupyter Notebook using Anaconda via Environments - not R Studio.
I'm trying to install R packages but it gives me the following errors:
install.packages('agricolae', repos="http://cran.rstudio.com/")
also installing the dependencies ‘units’, ‘sf’, ‘spdep’
Warning message in install.packages("agricolae", repos = "http://cran.rstudio.com/"):
“installation of package ‘units’ had non-zero exit status”Warning message in install.packages("agricolae", repos = "http://cran.rstudio.com/"):
“installation of package ‘sf’ had non-zero exit status”Warning message in install.packages("agricolae", repos = "http://cran.rstudio.com/"):
“installation of package ‘spdep’ had non-zero exit status”Warning message in install.packages("agricolae", repos = "http://cran.rstudio.com/"):
“installation of package ‘agricolae’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Then I try to load the library
library("agricolae")
Error in library("agricolae"): there is no package called ‘agricolae’
Traceback:
library("agricolae")
If I open with R Studio, I can make it work.
Does anybody know how to solve the issue on Jupyter Notebook?, I'm using macOs sierra 10.12.6.
Thank you very much

Installation of factoextra package in R studio

I am trying to install factoextra package in R Studio (v.1.2.1335 on Mac), however, I get error messages for each of the several approaches I tried.
I tried simple installation as well as installing the package source from https://cran.r-project.org/web/packages/factoextra/index.html.
install.packages("factoextra")
install.packages("~/Desktop/factoextra_1.0.5.tar.gz", repos = NULL, type = "source")
package ‘factoextra’ is available as a source package but not as a binary
Warning in install.packages :
package ‘factoextra’ is not available (for R version 3.1.2)
When installing the package source I get an error message:
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
unknown timezone 'zone/tz/2019a.1.0/zoneinfo/America/Toronto'
ERROR: dependency ‘ggpubr’ is not available for package ‘factoextra’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/factoextra’
Warning in install.packages :
installation of package ‘/Users/lihieder/Desktop/factoextra_1.0.5.tar.gz’ had non-zero exit status
I also tried installing package ggpubr but run into similar issues even when trying to install the source package for ggpubr.
Any ideas?
only use
install.packages("factoextra")

In R on Jupyter Notebook: “there is no package called ‘faraway’”

I am using R on jupyter notebook
I am trying to learn some commands
I install the package as in
install.packages('faraway', repos='http://cran.us.r-project.org')
The outcome was
also installing the dependencies 'minqa', 'nloptr', 'RcppEigen', 'lme4'
Warning message in install.packages("faraway", repos = "http://cran.us.r-project.org"):
"installation of package 'minqa' had non-zero exit status"
Warning message in install.packages("faraway", repos = "http://cran.us.r-project.org"):
"installation of package 'nloptr' had non-zero exit status"
Warning message in install.packages("faraway", repos = "http://cran.us.r-project.org"):
"installation of package 'RcppEigen' had non-zero exit status"
Warning message in install.packages("faraway", repos = "http://cran.us.r-project.org"):
"installation of package 'lme4' had non-zero exit status"
Warning message in install.packages("faraway", repos = "http://cran.us.r-project.org"):
"installation of package 'faraway' had non-zero exit status"
Updating HTML index of packages in '.Library' Making 'packages.html' ... done
In the terminal I got that
ERROR: dependency ‘lme4’ is not available for package ‘faraway’
* removing ‘/anaconda3/lib/R/library/faraway’
The downloaded source packages are in
‘/private/var/folders/sk/ls5hgt056k72k2yxpm01jct00000gn/T/RtmpZijWPV/downloaded_packages’
[I 07:36:55.974 LabApp] Saving file at /4/Untitled1.ipynb
[E 07:36:55.984 LabApp] Notebook JSON is invalid: Additional properties are not allowed ('execution_count' was unexpected)
Failed validating 'additionalProperties' in error:
On instance['cells'][7]['outputs'][0]:
{'ename': 'ERROR',
'evalue': 'Error in library("minqa"): there is no package called ‘minqa’\n',
'execution_count': 3,
'output_type': 'error',
'traceback': ['Error in library("minqa"): there is no package called '
'‘minqa’\n'
'Tr...',
'1. library("minqa")',
'2. stop(txt, domain = NA)']}
then afterwards
require('faraway')
The outcome was
Loading required package: faraway Warning message in library(package,
lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
“there is no package called ‘faraway’”
also if I command
library('faraway')
Error in library("faraway"): there is no package called ‘faraway’
Traceback:
Is there any advice on this? Thank you
Your first line of code worked for me
install.packages('faraway', repos='http://cran.us.r-project.org')
try this:
conda install -c conda-forge r-faraway

Installing package

I come across this problem when I install the package
"TxDb.Hsapiens.UCSC.hg19.knownGene" from Bioclite on RStudio v.1.1442. Below is the error message:
Warning messages:
/TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2.tar.gz' had status 3
2: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘TxDb.Hsapiens.UCSC.hg19.knownGene’ had non-zero exit status
I also tried to install this package, but it did not work either:
Warning in install.packages :
package ‘parallel’ is not available (for R version 3.4.3)
Warning in install.packages :
package ‘parallel’ is a base package, and should not be updated
I do not understand what the warnings mean and can someone please help me with resolving this issue?
Thank you.
Some further details would be very helpful - especially the code that you actually used.
What OS are you working on?
Is this a fresh install of R?
Have you previously had TxDB.... installed?
Are you working in a conda environment or similar?
Why did you download the gzipped version of the package?
In a fresh R-3.4.3 environment on Ubuntu I get the following
source("http://www.bioconductor.org/biocLite.R")
## installing source BiocInstaller blah blah success
biocLite("TxDb.Hsapiens.UCSC.hg19.knownGene")
Warning messages:
1: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘RMySQL’ had non-zero exit status
2: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘GenomicFeatures’ had non-zero exit status
3: In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘TxDb.Hsapiens.UCSC.hg19.knownGene’ had non-zero exit status
This suggests that if I wanted to install TxDB... I'd have to get RMySQL installed first, and then GenomicFeatures and then ....
Could you post all the code you used and all the contents of the warning messages that you received, please.

Resources