Where gg_issue.Rmd reads in gg_chunk.R as a chunk and contains an animation from gganimate, the figure that is animated is saved in a different location than a generic plot. The contents of gg_issue.Rmd is:
The specific error is:
`pandoc: Could not fetch gg_issue_files/figure-revealjs/animate-cars-1.gif
gg_issue_files/figure-revealjs/animate-cars-1.gif: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 67
Execution halted`
What appears to be happening is that the animation is saved in a folder of `gg_issue_files/figure-revealjs/` is created at the same level as `folder` instead of within `folder`. There is also a `gg_issue_files/figure-revealjs/` within `folder` which contains the generic plot. The .Rmd will work fine without the animation.
This particular issue only occurs when the .Rmd file is within a folder (and the `opts_knit$set(root.dir = normalizePath(".."))` is no longer present).
With a file structure of:
Where gg_issue.Rmd reads in gg_chunk.R as a chunk and contains an animation from gganimate, the figure that is animated is saved in a different location than a generic plot. The contents of gg_issue.Rmd is:
Title
---- start --------------------------------------------------------------
library("gganimate")
---- generic ------------------------------------------------------------
ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot()
---- animate-cars -------------------------------------------------------
ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot() + transition_manual(gear)