I am trying to make a simple plot, similar to that (this code also gives me the error):
df = data.frame(x=c(1,2,3,4),y=c(4,5,1,5))
ggplot(df) + geom_point(aes(x,y))
Other functions like geom_jitter etc. work seamlessly.
I've tried R 4.5.1 and R 4.5.2 and I still get the following error:
Error in list2(na.rm = na.rm, ...): object 'ffi_list2' not found
Traceback:
1. layer(mapping = mapping, data = data, geom = "point", stat = stat,
. position = position, show.legend = show.legend, inherit.aes = inherit.aes,
. params = list2(na.rm = na.rm, ...))
2. list2(na.rm = na.rm, ...)
3. .handleSimpleError(function (cnd)
. {
. watcher$capture_plot_and_output()
. cnd <- sanitize_call(cnd)
. watcher$push(cnd)
. switch(on_error, continue = invokeRestart("eval_continue"),
. stop = invokeRestart("eval_stop"), error = NULL)
. }, "object 'ffi_list2' not found", base::quote(list2(na.rm = na.rm,
. ...)))
This happens regardless of the environment. Pure R, JupyterLab, R Studio. How to workaround this?
Update: The ggplot2 patch is on CRAN now, so if you update ggplot2 to >=4.0.2 with install.packages("ggplot2") and then restart R, then the problem should go away.
---
I believe this is an unfortunate result of ggplot2 accidentally (at least I don't think it was on purpose) capturing rlang::list2()'s definition at ggplot2 build time.
I have documented this issue here https://github.com/tidyverse/ggplot2/issues/6796, we will try and get out a ggplot2 release soon that fixes this.
I believe if you do the following, you can get back up and running:
remove.packages("rlang")
Restart R to be safe
install.packages("rlang")
Restart R to be safe
Try your code again
That should put you on rlang 1.1.7, which has ffi_list2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With