1
votes

I have an R package that I would like to install from here, and as instructed by the authors, the way we should install it is as follows:

install.packages("uba_0.7.7.tar.gz",repos=NULL,dependencies=T)

Thsi gives me the following error in R studio:

Warning: invalid package 'uba_0.7.7.tar.gz' Error: ERROR: no packages specified In R CMD INSTALL Warning in install.packages : installation of package ‘uba_0.7.7.tar.gz’ had non-zero exit status

There is a similar question on stack overflow. I tried doing as such after downloading the .tar.gz file:

install.packages("C:/Users/96171/Downloads/uba_0.7.7.tar.gz",repos=NULL,type="source")

But still having an error:

ERROR: dependency 'Hmisc' is not available for package 'uba' * removing 'C:/Users/96171/Documents/R/win-library/3.5/uba' In R CMD INSTALL Warning in install.packages : installation of package ‘C:/Users/96171/Downloads/uba_0.7.7.tar.gz’ had non-zero exit status

However I tried:

install.packages("Hmisc")

as well as:

install.packages("Hmisc", dependencies = T)

But both did nothing. It is also important to note that I have RTools installed. The error is still the same:

Installing package into ‘C:/Users/96171/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified) ERROR: dependency 'Hmisc' is not available for package 'uba' * removing 'C:/Users/96171/Documents/R/win-library/3.5/uba' In R CMD INSTALL Warning in install.packages : installation of package ‘C:/Users/96171/Downloads/uba_0.7.7.tar.gz’ had non-zero exit status

I also tried installing it from the cmd, It is not giving me the Hmisc error.

sessionInfo()

R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.3 tools_3.5.3  

I checked the installed packages needed for the intended package and got the following:

> "operators" %in% rownames(installed.packages())
[1] TRUE
> "class" %in% rownames(installed.packages())
[1] TRUE
> "fields" %in% rownames(installed.packages())
[1] TRUE
> "ROCR" %in% rownames(installed.packages())
[1] TRUE
> "DmwR" %in% rownames(installed.packages())
[1] FALSE
> "Hmisc" %in% rownames(installed.packages())
[1] FALSE

So I have all except Hmisc, how can I install it correctly?

1
What does your sessionInfo() say? Pls do add this hereGWD
From a quick look at the package description and namespace files you may require other packages; I ran install.packages(c("operators","class", "fields", "ROCR", "DMwR", "Hmisc")) and then uba installed okay. ps your R version is a wee bit old which can cause issues when installing so do make sure the dependencies install correctlyuser20650
@Hiyam; no that shouldn't matter. Are you sure that they all installed correctly?user20650
@Hiyam; it may be that Hmisc will not install due to your version as some of the dependencies / imports require a certain package version (see cran.r-project.org/web/packages/Hmisc/index.html) -- these may not be available for 3..5.3. Try updating your R version -- we are now at version 3.6.2user20650
afaik Hmisc requires compilation; what messages do you get when trying to install the package `install.packages("Hmisc", type = 'source') PS: try doing in the RGui not RStudio!GWD

1 Answers

1
votes

After spending about an hour, thanks to @user20650 and @GWD I was able to solve my problem as follows:

  • I previously had R 3.5.3, I upgraded to the latest version 3.6.2
  • Steps to upgrade R if you already have it: tutorial 1 and tutorial 2
  • After having R 3.6.2, I used RGui rather that RStudio to install Hmisc
  • I typed in the GUI console: install.packages("Hmisc"); it prompts you for a message about compilation, I clicked on NO