1

I am using a ubuntu AMI in my AWS and have launched a R studio server.

I am finding trouble in installing the R packages.

Whenever I try to install the packages I get an error

> Installing package into
> ‘/home/rstudio2/R/x86_64-pc-linux-gnu-library/3.0’ (as ‘lib’ is
> unspecified) Warning in install.packages :   dependency ‘xml2’ is not
> available also installing the dependencies ‘jsonlite’, ‘mime’, ‘curl’,
> ‘openssl’, ‘R6’, ‘httr’, ‘base64enc’, ‘digest’, ‘aws.signature’
> 
> 
> The downloaded source packages are in
>   ‘/tmp/Rtmp1BrKS6/downloaded_packages’

Could anyone help me to backtrace the reason for error. Would be thankful, I have spent almost a day . could not figure out

Rohi
  • 385
  • 2
  • 3
  • 15

1 Answers1

1
dependency ‘xml2’ is not available

From this error, we can understand that package XML2 is missing. You need to install the system library libxml2-dev to install the XML2 package. So use the following command to install the package:

sudo apt install libxml2-dev

After this proceed with R package installation.

Nico Albers
  • 1,556
  • 1
  • 15
  • 32
Venkatesh Wadawadagi
  • 2,793
  • 21
  • 34
  • @venkatest : I would like to know, suppose if i would need VIm package, is it something like the above that i need to first install dependencies and then try installing the package ? – Rohi Mar 22 '18 at 12:50
  • I tried to download an another package VIM ; I get an error ERROR: **compilation failed for package ‘VIM’ removing ‘/home/rstudio2/R/x86_64-pc-linux-gnu-library/3.0/VIM Warning in install.packages : installation of package ‘VIM had non-zero exit status The downloaded source packages are in ‘/tmp/RtmpDeIfw7/downloaded_packages’** Could you tell me where I am making mistake – Rohi Mar 22 '18 at 13:18
  • @Rohi: can you Install R package with dependencies from CRAN mirror as mentioned in this answer: https://stackoverflow.com/questions/25017195/install-a-local-r-package-with-dependencies-from-cran-mirror – Venkatesh Wadawadagi Mar 22 '18 at 13:28
  • It dint work for me .. I tried all the possible ways i coul – Rohi Mar 22 '18 at 17:44