2

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?

Phil
  • 7,287
  • 3
  • 36
  • 66
Perl Del Rey
  • 959
  • 1
  • 11
  • 25
  • 1
    What does your `sessionInfo()` say? Pls do add this here – GWD Feb 09 '20 at 18:36
  • 2
    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 correctly – user20650 Feb 09 '20 at 18:43
  • @user20650 I did install all these packages, but seperately rather than in one command, or does the order in which they are installed matter ? – Perl Del Rey Feb 09 '20 at 18:45
  • @GWD done. Please find them in the last section – Perl Del Rey Feb 09 '20 at 18:45
  • 1
    @Hiyam; no that shouldn't matter. Are you sure that they all installed correctly? – user20650 Feb 09 '20 at 18:50
  • @user20650 Please see the last section of my problem, I updated it. I have all the packages that you clarified installed, except for ```Hmisc``` its not being installed properly – Perl Del Rey Feb 09 '20 at 18:59
  • 1
    @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 https://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.2 – user20650 Feb 09 '20 at 19:01
  • 1
    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 Feb 09 '20 at 19:16
  • @GWD I do get a message saying 'Do you want to download Hmisc with its compilation' and I say yes. Also, I have been trying to download Hmisc from RStudio its taking forever, the same thing does not happen in RGui ? – Perl Del Rey Feb 09 '20 at 19:25
  • 1
    just have RGui do the installation (from source) for you - will be available in R (and RStudio equally) – GWD Feb 09 '20 at 19:27
  • 1
    @Hiyam; dont install Hmisc from source use the binaries (this is almost certainly easier for you and will install dependencies as well if you want) -- bt as previously commented you may need to -- and probably should -- upgrade your r version. – user20650 Feb 09 '20 at 19:29
  • 1
    @user20650 Thank you so much for your help both; I answered my question and referenced you. Much appreciated!! – Perl Del Rey Feb 09 '20 at 19:34
  • @GWD Thank you so much for your help both; I answered my question and referenced you. Much appreciated!! – Perl Del Rey Feb 09 '20 at 19:34

1 Answers1

1

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
Perl Del Rey
  • 959
  • 1
  • 11
  • 25