简体   繁体   中英

Unable to install XML package to Rstudio

I'm trying to install XML Package to Rstudio Using the ribbon: Tools--> Install Packages --> Packages: to type XML, but the dropdown list opend had only this packages: xml2, XML2R, xml2relational, xmlparsedata, xmlr, xmlrpc2.

Next, I tried:

install.packages("XML")

but received the warning:

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘D:/BCDD/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘XML’ is not available (for R version 3.6.3)

So I followed the link above: https://cran.rstudio.com/bin/windows/Rtools/ and using these questions:

  1. Why can't I install the XML package
  2. Cannot install package XML to R

Then tried

install.packages("XML", repos = "http://www.omegahat.net/R",type="source")

but received the same warning and more:

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘D:/BCDD/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'http://www.omegahat.net/R/src/contrib/XML_3.99-0.tar.gz'
Content type 'application/x-gzip' length 1547930 bytes (1.5 MB)
downloaded 1.5 MB

* installing *source* package 'XML' ...
** using staged installation
Please define LIB_XML (and LIB_ZLIB, LIB_ICONV)
ERROR: configuration failed for package 'XML'
* removing 'D:/BCDD/Documents/R/win-library/3.6/XML'
Warning in install.packages :
  installation of package ‘XML’ had non-zero exit status

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

Any help to how to install the package XML will be appreciated

You can download the version you want from here: https://cran.rstudio.com//src/contrib/Archive/XML/

According to their GitHub repo, version 3.99-0.3 should work for you, I can't try it out coz I have R4.0 and I can install only the most recent [3.99-0.5].

Alternatively, when you choose the version you want and run on your R console:

devtools::install_version("XML", version = "3.99-0.3") # or the version you want

Have a try. Let me know.

Check this RStudio Support post which covers how to install older versions of packages.

Be sure to install rtools35 from the archive

Going to R 4.0.2 is not a particularly bad idea at this point.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM