3

I am trying to install kableExtra and get the following errors:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = 
vI[[j]]) : 
there is no package called 'hms'
ERROR: lazy loading failed for package 'kableExtra'

*removing 'C:/Users/Tim/Documents/R/win-library/3.2/kableExtra'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" CMD INSTALL -l "C:\Users\Tim\Documents\R\win-library\3.2"      
C:\Users\Tim\AppData\Local\Temp\RtmpUJQfwD/downloaded_packages/kableExtra_0.9.0. 
 tar.gz' had status 1
Warning in install.packages :
installation of package ‘kableExtra’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\Tim\AppData\Local\Temp\RtmpUJQfwD\downloaded_packages’

How can I solve my problem? Thanks in advance!

Dan
  • 11,370
  • 4
  • 43
  • 68
Timitrov
  • 211
  • 1
  • 3
  • 14

2 Answers2

2

it seems kableExtra depends on the package "hms" so try install it before with:

install.packages("hms")

or via rstudio interface: packages -> install and type in "hms"

also try this command:

install.packages("kableExtra", dependencies = TRUE)

If there appear problems like installing rlang or something similar, there is no general solution for this. You can try to (re)install rtools. Sometimes there are missing parts of r installations. My guess if R can't install a dependencie is, that some library or tools of the R environment are missing or wrongly installed which have to be detected.

mischva11
  • 2,811
  • 3
  • 18
  • 34
  • Then I get the information that 'rlang' is not available for package 'hms' and I can't install 'rlang' – Timitrov Jun 04 '18 at 21:51
  • Why can't you install `rlang`? – Dan Jun 04 '18 at 21:56
  • you could also try: install.packages("kableExtra", dependencies = TRUE) this will install all dependent packages und suggestions, though it could not work with your error of installing rlang. But worth a try – mischva11 Jun 04 '18 at 22:10
0

You have a trouble with the dependency with the package "hms". I have not got how you are installing the r package, but you can either install it first and then try it again or start the installation with the option of download and install all required dependencies, in the second option you need to be online and allow the package manager to intall what is required.

Here is how it looks in RGui. I guess your are not using RGui.

enter image description here

enter image description here

Marco
  • 4,000
  • 3
  • 25
  • 26
  • Then I get the following errors: ERROR: dependency 'rlang' is not available for package 'hms' * removing 'C:/Users/Tim/Documents/R/win-library/3.2/hms' Warning in install.packages : running command '"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" CMD INSTALL -l "C:\Users\Tim\Documents\R\win-library\3.2" C:\Users\Tim\AppData\Local\Temp\RtmpiCcuL8/downloaded_packages/hms_0.4.2.tar.gz' had status 1 Warning in install.packages : installation of package ‘hms’ had non-zero exit status – Timitrov Jun 04 '18 at 21:49
  • The list of dependencies could be quite large. Have a look to this post https://stackoverflow.com/questions/14171148/how-to-tell-cran-to-install-package-dependencies-automatically – Marco Jun 04 '18 at 22:01
  • you have not said too much about your system and enviroment. – Marco Jun 04 '18 at 22:05
  • I tried RGui now but it isn't working with the same error: 'ERROR: dependency 'rlang' is not available for package 'hms' ' when I try to install hms. – Timitrov Jun 05 '18 at 17:04