This is a pull request, meaning that the code is available on GitHub as a branch, but hasn't yet been merged in gganimate
master.
You could clone it or copy the modified package directory on your system.
Then :
- make sure that
devtools
package is installed
- open
gganimate.Rproj
- run
devtools::load_all(".")
The parallel version is ready to run :
anim <- ggplot(mtcars, aes(mpg, disp)) +
transition_states(gear, transition_length = 2, state_length = 1) +
enter_fade() +
exit_fade()
future::plan("sequential") ## default
t0 <- system.time(animate(anim))
print(t0)
# user system total
# 4.384615 1.360656 1.893855
future::plan("multiprocess", workers = 4L)
t1 <- system.time(animate(anim))
# user system total
# 1.30 0.61 3.58
print(t0 / t1)
# user system total
# 4.384615 1.360656 1.893855
To avoid load_all
you could open the DESCRIPTION
file and rename the package :
Package: gganimateparallel
Type: Package
Title: A Grammar of Animated Graphics
...
As vignettes seem to have difficulties to build, you can just remove the vignettes
directory.
Then RStudio / Build / Install and restart
or from the package's directory
Rcmd.exe INSTALL --no-multiarch --with-keep.source .
gganimateparallel
is now available on your system as a library.
Credits @HenrikBengtsson for the incredible job done on future
!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…