1

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

Progman
  • 16,827
  • 6
  • 33
  • 48
Joe Snider
  • 11
  • 1
  • 2
    providing the output of `sessionInfo()` might help to troubleshoot. – Valeri Voev Feb 01 '22 at 20:56
  • 1
    Hi Joe Snider! Did you try to update the packages (`update.packages()`), install a new version of Rcpp (`install.packages('Rcpp')`) and restart R? – Jose Feb 02 '22 at 00:23

1 Answers1

1

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.

Ari
  • 1,819
  • 14
  • 22