Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Hmisc" package or namespace failed to load - no package called 'latticeExtra'

Tags:

r

hmisc

I'm having trouble loading and running the Hmisc package. When installing it, I get the following error;

library(Hmisc)
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2
Error: package or namespace load failed for ‘Hmisc’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘latticeExtra’

I'm running Rstudio 3.5.3

I've tried to update all packages. The flow on effect is I have code that labels variables, which no longer runs and gives the following error.

label(data$facem_360_v1_timestamp)="Survey Timestamp"
Error in label(data$facem_360_v1_timestamp) = "Survey Timestamp" : 
  could not find function "label<-"

Any suggesions would be appreciated.

like image 524
Mick Avatar asked Dec 20 '19 03:12

Mick


3 Answers

The latest version of latticeExtra 0.6-29 requires R (≥ 3.6.0) as you can see in https://cran.r-project.org/web/packages/latticeExtra/index.html. Having the same problem as you installing Hmisc, I downloaded the previous release of latticeExtra, 0.6.28 from https://cran.r-project.org/src/contrib/Archive/latticeExtra/ and installed it:

R CMD INSTALL latticeExtra_0.6-28.tar

I could then install the Hmisc latest version:

R CMD INSTALL Hmisc_4.3-0.tar
like image 118
Roberto Vázquez Lucerga Avatar answered Oct 20 '22 04:10

Roberto Vázquez Lucerga


Your problem is simple: LatticeExtra is not compatible with R versions < 3.6.0.

To fix this, simply update R to the latest version, then install Hmisc again. It should automatically install all the dependencies, including latticeExtra. To be sure, run install.packages() with option dependencies=T.

like image 39
MentalManiak Avatar answered Oct 20 '22 03:10

MentalManiak


We also had same problem while publishing app & later we installed & configured R-3.6.0 REF URL for upgrading R: https://docs.rstudio.com/resources/install-r-source/

Procedure to update R version ( Make sure you are running this conf as root user):

#export R_VERSION=3.6.3
#curl -O https://cran.rstudio.com/src/base/R-3/R-${R_VERSION}.tar.gz
#tar -xzvf R-${R_VERSION}.tar.gz -C /opt
#cd R-${R_VERSION}

#yum deplist R 

#./configure --prefix=/opt/R/${R_VERSION} --enable-memory-profiling --enable-R-shlib --with-blas --with-lapack --with-readline=no

#make 

#make install

#ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R                           
#ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript

Rstudio supports says latticeExtra requires R >= 3.6 so you have to update R in order to been able to install ithere

NOTE: We can run both version of R is 3.5 & 3.6

like image 1
Santosh Garole Avatar answered Oct 20 '22 04:10

Santosh Garole