Home > Software design >  gganimate parallel - Provided file does not exist error
gganimate parallel - Provided file does not exist error

Time:09-22

I am attempting to use gganimate with parallel processing, but when using anim_save, I get a "Provided file does not exist" error." It also says "Called from: png_dim(framesenter image description here

Because both b and anim_save give the same or very similar errors, I conclude that it is not a problem with anim_save, but more likely something having to do with gganimatep.

Another example. Using example code from the gganimate website (enter image description here

As mentioned above, it is the "Provided file does not exist" error." And "Called from: png_dim(framesenter image description here

Note that another thing (not a MWE) that also doesn't work with gganimatep is:

a <- ggplot(weather2)   
    geom_sf(aes(fill = temp, geometry=geometry, group=NAME))   
    scale_fill_viridis_c(name = NULL)   
    theme_map()  
    transition_time(as.integer(date))  
    labs(subtitle = paste('Date: {frame_time}')) 

setwd("/")
plan(multisession, workers = 7)
gganimatep::anim_save("tmean_2020.gif", a, end_pause=8, width = 600, height = 400, duration=30, nframes=300)

What can I do to fix this? Thanks!

CodePudding user response:

From trial and error, the following seems to be the problem: the package needs to be build from the GitHub pull request (a) (as described here) and needs to be named gganimate to satisfy internal dependencies.

After setting up the environment correctly, parallel processing seems to work without using the plan(multisession, workers=7) command, but using it appears to throw an error.

(see the discussion under the question for more details)

  • Related