- Download the latest binary of the xml2 package from here: https://cran.r-project.org/web/packages/xml2/index.html, you want:
OS X El Capitan binaries: r-release: xml2_1.1.1.tgz
(or similar). - Extract to a local dir with
tar -xvf xml2_1.1.1.tgz
. - Find where libxml2 is installed (or install with
brew install libxml2
), mine is/usr/local/Cellar/libxml2/2.9.4_3
. - Set environment variable
export LIBXML_INCDIR=/usr/local/Cellar/libxml2/2.9.5
using the path from above. - Install to the appropriate library:
R CMD INSTALL -l ~/Documents/OMSQ_RAP/packrat/lib/x86_64-apple-darwin15.6.0/3.4.1/ .
. Note that this installs into a packrat library, if you just want a system install do:R CMD INSTALL .
et voila!
UPDATE: This works for installing xml2, but it doesn't seem to work as a dependency for other packages that require it.