Closed ndaniel closed 7 years ago
@ndaniel Thanks for the report!
It looks like the problem is because of the ggplot2
version. You are using v2.2.0, while we currently support v2.1.0.
Could you please try out the simple example below and provide the output?
library(animint)
mtcars$cyl <- as.factor(mtcars$cyl)
plot_car <- ggplot()+geom_point(aes(mpg, disp,
colour=cyl),
data = mtcars)
animint2dir(list(plot=plot_car), "test_plot")
@tdhock It looks like the chunk_vars
issue is resolved with the ggplot2
v2.2.0. Should we update animint
to support this?
I tried that it shows this error:
> library(animint)
Loading required package: ggplot2
> mtcars$cyl <- as.factor(mtcars$cyl)
> plot_car <- ggplot()+geom_point(aes(mpg, disp, colour=cyl), data = mtcars)
> animint2dir(list(plot=plot_car), "test_plot")
Error in if (attributes(margin.value)$unit == "pt") { :
argument is of length zero
@ndaniel I upgraded to ggplot2
v2.2.0 on my system and got the same error.
To solve this you could simply install the version 2.1.0. I would recommend installing it from the branch we depend on. You could just run the code below, preferably in a fresh R session:
devtools::install_github("faizan-khan-iit/ggplot2@5fb99d0cece13239bbbc09c6b8a7da7f86ac58e2")
library(animint)
example(animint)
This should solve your issue. Please do report if you have any other problems.
Ok. I will do that! Thx!
Hi, I am facing the same error when running the example. I changed my ggplot2 version as suggested by you in the comments but now I get this error : Error in as.vector(y) : attempt to apply non-function. Appreciate your help.
Running this:
gives this error:
More info is here:
It looks like it might be related to: https://github.com/tdhock/animint/issues/88