2

I am trying to install the CRAN Hmisc package in an R Environment Notebook on IBM Watson Studio. But it repeatedly fails with the following Error:

install.packages('Hmisc')

also installing the dependencies ‘checkmate’, ‘rstudioapi’, ‘Formula’, ‘latticeExtra’, ‘acepack’, ‘gridExtra’, ‘htmlTable’, ‘viridis’

Warning message in install.packages("Hmisc"):
“installation of package ‘viridis’ had non-zero exit status”Warning message in install.packages("Hmisc"):
“installation of package ‘Hmisc’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

I tried to separately install the viridis package and that also fails with the same error:

install.packages('viridis')

Warning message in install.packages("viridis"):
“installation of package ‘viridis’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Sumit Goyal
  • 575
  • 3
  • 16

2 Answers2

1

What I did was go down a version of the library using devtools:

require(devtools)
install_version('Hmisc',  version = "4.1-0")

Then I installed it again:

install.package('Hmisc')

You can then load the library library('Hmisc') and run sessionInfo() to see that you're running the latest version. It's a workaround and I don't know why it initially doesn't want to install. Perhaps it has something to do with R in DSX using version 3.3.2 and some libraries are missing? I haven't a clue.

Dr G.
  • 1,298
  • 9
  • 17
1

In turns out to be an incorrect dependency management on viridis. It has a dependency over viridisLite >= 0.2.0. Latest viridis is expecting an object called cividis which was only added on the latest version of viridisLite > 0.2.0. DSX has viridisLite==0.2.0 already installed. Hence, the install of viridis fails. So basically, explicitly installing a newer version of viridisLite solves the issue.

install.packages(c('viridisLite', 'Hmisc'))

TL;DR - Install latest viridisLite and then install Hmisc

Sumit Goyal
  • 575
  • 3
  • 16