tags:

views:

32

answers:

2

This is not a programming question per se - but I hope someone can help: I can't install odfWeave - it looks like the problem is with the package XML - which i can't install either.

checking for xml2-config... no Cannot find xml2-config ERROR: configuration failed for package ‘XML’ * removing ‘/home/andreas/R/i486-pc-linux-gnu-library/2.10/XML’ * installing source package ‘odfWeave’ ... ** R ** inst ** preparing package for lazy loading Warning in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : there is no package called 'XML' Error : package 'XML' could not be loaded ERROR: lazy loading failed for package ‘odfWeave’ * removing ‘/home/andreas/R/i486-pc-linux-gnu-library/2.10/odfWeave’

Any help much appreciated

System: ubuntu 9.04

A: 
sudo apt-get install libxml2-dev

it should work after that...

aL3xa
See my answer about `apt-get install r-cran-xml` which should be easier for most users.
Dirk Eddelbuettel
What's the catch? I have had problems with installing `XML` R package and managed to install it after installing `libxml2-dev` package. `odfWeave` depends on `XML` package... and now I installed `r-cran-xml`... so is it some kind of metapackage, or what? What's the difference between `r-cran-xml` and R `XML` package?
aL3xa
The `XML` package must be built from source and so needs to find an XML parsing library to link against- in this case libxml2. The development headers must be installed for the compiler to perform the link, hence the need for `libxml2-dev`. `r-cran-xml` is distributed as a precompiled Debian binary, so no compiling needs to take place. The only difference is that the version of `XML` provided by `r-cran-xml` may lag behind what you could get by building `XML` from source.
Sharpie
@Sharpie, thanks for info!
aL3xa
+2  A: 

Better still: sudo apt-get install r-cran-xml

Dirk Eddelbuettel
Thank you both! I am now a happy camper. - Is it always recommended to use apt-get instead of install.packages()?
Andreas
No, it's more complicated as Ubuntu may lag in time (as the release freezes). This gets discussed on r-sig-debian (also for Ubuntu) from time to time -- look there. But if the other approach fails, it is always better ;-)
Dirk Eddelbuettel