0

When I run the below code, using the tsibble package, I get the error message:

Error: Problem with `mutate()` column `Month`.
i `Month = yearmonth(Month)`.
x function 'Rcpp_precious_remove' not provided by package 'Rcpp'

I tried reinstalling Rcpp, updating Rcpp, and nothing works yet. Can someone please help with this issue?

Code:

library(dplyr)
library(Rcpp)
library(tsibble)

z <- data.frame(
  Month = c("2019 Jan","2019 Feb","2019 Mar","2019 Apr","2019 May"),
  Observation = c(50,23,34,30,25)
)

z <- as_tibble(z)

z %>%
  mutate(Month = yearmonth(Month)) %>%
  as_tsibble(index = Month)
Village.Idyot
  • 1,359
  • 2
  • 8
  • [Rcpp package doesn't include Rcpp_precious_remove](https://stackoverflow.com/questions/68416435/rcpp-package-doesnt-include-rcpp-precious-remove) – Isaiah Nov 30 '22 at 12:30
  • 1
    What version of R are you on? You can check the R version with `R.version`. (code runs fine for me, btw) – Isaiah Nov 30 '22 at 12:42
  • 1
    As hinted by @Isaiah that is almost surely due to a binary build of `tsibble` against a different version of `Rcpp` than you are running. Simply upgrading both to what is current at CRAN should fix it. – Dirk Eddelbuettel Nov 30 '22 at 13:27
  • I've updated both and it still doesn't work. So the answer may lie in updating my version of R? I – Village.Idyot Nov 30 '22 at 14:23
  • Looks like tsibble isn't installing on my computer. I'm researching that now – Village.Idyot Nov 30 '22 at 14:47
  • OK I updated my R version and the above code now works! Thanks! – Village.Idyot Nov 30 '22 at 15:57
  • 1
    OK I updated my R version and it works fine! Thanks Isaiah! – Village.Idyot Nov 30 '22 at 18:25
  • @DirkEddelbuettel I see this was closed as a duplicate of "Rcpp package doesn't include Rcpp_precious_remove", which has two answers, each of which is `install.packages('Rcpp')`. However, after closure, the OP has tried `install.packages('Rcpp')` which did not work. OP then updated R, which did work, but was not mentioned in "Rcpp package doesn't include Rcpp_precious_remove". Was wondering if this was still a duplication? Perhaps it was not updating R itself, but a sideeffect, such as forcing an update of all packages. – Isaiah Dec 01 '22 at 10:56
  • @Isaiah You can search about the error message here at SO, and on the mailing lists. It is exactly as I described (a cross between versions of package depended upon and using --ie compiled with newer, running with older) which affect only users of compiled packages. None of this had anything to do with R itself but only with partial updates from packages. And it got long sorted out for everybody using releases made since. This all happened a while back. – Dirk Eddelbuettel Dec 01 '22 at 15:38

0 Answers0