Error: ScalesList was built with an incompatible version of ggproto

3.8k views Asked by At

I'm doing a presentation in slidfy, using the deckjs framework. Everything was ok, but suddenly this chunk of code:

ggplot(cars, aes(x = speed, y = dist)) +  geom_point(color = 'red') + stat_smooth(method = "lm", formula = y ~ x, size = 0.5, se = F)

stopped working and shows this error instead:

## Error: ScalesList was built with an incompatible version of ggproto.
## Please reinstall the package that provides this extension.

The code works perfectly when executed from source or console... But it doesn't work anymore from the R markdown. The function that fails is the stat_smooth(). The rest visualizes ok if executed without the smooth.

Here and here a similar error is reported, and the solution offered is to reinstall ggplot and the packages from github, but I'm not sure which packages should I install, and, besides, the code only fails from Rmarkdown, and not when executed from console or source.

Thanks

4

There are 4 answers

0
Pablo On BEST ANSWER

This is very strange; now things are back to normal.

I did what @baptiste suggested, and the R source code just worked ok. After that, I knitted the Rmarkdown again and the error had disappeared!

0
userJT On

in Feb 2017 the same error was resolved by re-installing all the packages (RStudio - Tools - Check for package updates)

1
user7599321 On

I had a similar problem in RMarkdown after updating ggplot2. I was loading a workspace with plots created with the older version of ggplot2. The solution was to recreate that workspace with the updated version, and now RMarkdown works.

0
raja On

I had similar problem with geom_tufteboxplot . I first updated ggplot2 & ggthemes package, then detached all ggplot related packages and reloaded them. It worked for me.