Open eliocamp opened 6 years ago
Thanks. The problem here is that I have yet to add support for computed variables in the different transition functions... This will come and it is nice to have a use case
We have produced the same error in gganimate using this code:
`T <-ggplot(NOISEY, aes(month_day, hour, group = month))+
geom_line()+
transition_reveal(month, month_day)
animate(T)`
the resulting error
Error in seq.default(range[1], range[2], length.out = nframes) : 'from' must be a finite number
NOISEY is a dataset is a collection of local crime reports, month_day is the day of the month int, month is month dbl, hour is int.
We wrote this to mirror:
`p <- ggplot(airquality, aes(Day, Temp, group = Month)) + geom_line() + transition_reveal(Month, Day)
animate(p)`
Which produces a successful plot.
We have also tried as.numeric() and using only numeric elements of our plot.
Perhaps to answer my own question, gganimate seems to really need numbery numbers
The following examples adapt another dataset and create random data
`??airquality
p <- ggplot(airquality, aes(Day, Temp, group = Month)) +
geom_line() +
transition_reveal(Month, Day)
animate(p)
library(ggvis)
??cocaine
p <- ggplot(cocaine, aes(month, price, group = state)) +
geom_line() +
transition_reveal(month, month)
animate(p)
A<-sample(1:100, 50, replace=TRUE)
B<-sample(1:100, 50, replace=TRUE)
C<-sample(1:3, 50, replace=TRUE)
D<-sample(1:3, 50, replace=TRUE)
G<-data.frame(A,B,C,D, stringsAsFactors = FALSE)
View(G)
p <- ggplot(G, aes(A, B, colour = D, group = C)) +
geom_line() +
transition_reveal(A, A)
animate(p)`
In short, the transition vars really seem to need to be numeric.
I've seen your call for stress testing gganimate with weird geoms and wanted to comply. Package metR has
geom_streamline()
which computes streamlines from a vector field. One of the computed values isstep
which is a numeric value representing the integration step. With the old gganimate, I could map this variable toframe
and it worked, but now it seems to be broken.Here's a reprex
Here’s the basic plot showing also how the step variable works.
Using transition_manual seemed like the most logical transition
Or also transition_time
Created on 2018-08-02 by the reprex package (v0.2.0).