简体   繁体   中英

choroplethr package in R will not load

Loading required package: acs Loading required package: stringr Loading required package: XML

Attaching package: 'acs'

The following object is masked from 'package:base':

apply

Error: package or namespace load failed for 'choroplethr': .onLoad failed in loadNamespace() for 'units', details: call: udunits_init(path) error: function 'Rcpp_precious_remove' not provided by package 'Rcpp' In addition: Warning messages: 1: package 'choroplethr' was built under R version 4.0.5 2: package 'acs' was built under R version 4.0.5 3: package 'XML' was built under R version 4.0.5

As @jose pointed out in the comments, this can likely be solved by updating your packages. The error you copied is quite long, but the key part appears to be this:

error: function 'Rcpp_precious_remove' not provided by package 'Rcpp'

I am actually the author of choroplethr, and I have no idea what this function is, or why Rcpp is being loaded at all when you load choroplethr. But here we are.

When I paste that error message into DuckDuckGo, the first hit I get is this stackoverflow question.

There the solution appears to simply be typing:

install.packages('Rcpp')
library(Rcpp)

I recommend trying that and seeing if it works.

Regardless of whether that alone solves your problem, I also recommend following the other suggestion @jose made. Namely, typing:

update.packages()

And trying again.

Dependency management in R is a pain. It is probably worth getting into the habit of typing update.packages() when you get an error you don't recognize to see if it magically solves your problem.

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