Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Not Install XML Package

Tags:

r

xml

I can not install the latest XML package V3.9-4. I mannually install it in RGui by typing:

install.packages("LOCALDIR/XML_3.6-0.tar.gz", repos=NULL, type="source")

But get some error message:

* installing *source* package 'XML' ...
Please define LIB_XML (and LIB_ZLIB, LIB_ICONV)
ERROR: configuration failed for package 'XML'
* removing 'LOCALDIR/R/win-library/2.12/XML'
* restoring previous 'LOCALDIR/R/win-library/2.12/XML'

Anyone any idea?

Thx!

like image 998
billlee1231 Avatar asked Dec 06 '25 02:12

billlee1231


2 Answers

I fixed this for myself today, noting it here for prosperity.

On Unbuntu systems, you can fix this by loading libxml2-dev:

sudo apt-get install libxml2-dev

After I did that, install.packages("XML") ran without a hitch.

like image 136
Paulb Avatar answered Dec 07 '25 19:12

Paulb


You're a windows user (at least your path indicates so) and XML is not available for that OS using the standard binary install. So I see you've tried source, smart but there are pieces that can't compile without rtools and some magic voodoo. So you got two choices:

  1. Learn the magic voodoo to make it install correctly
  2. Go to the CRAN site and the read me file, which tells you Professor Ripley has put them together for you here. This is good to know because RCurl is there too. For a direct download of the package click HERE.

I can't help you with the voodoo as I opted for the second choice :)

like image 42
Tyler Rinker Avatar answered Dec 07 '25 18:12

Tyler Rinker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!