I would like to generate an animated graphic in PDF using the LaTeX animate package.
Code
---
title: "test_animations"
author: "Colours"
date: "27/10/2017"
output:
pdf_document:
includes:
in_header: header_ani.tex
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
pacman::p_load(gganimate, gapminder, ggplot2)
```
## Test animations
```{r sample_ani, fig.show='animate', message=FALSE, warning=FALSE}
p2 <- ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop)) +
geom_point() +
geom_point(aes(frame = year), color = "red") +
scale_x_log10()
gganimate(p2, saver = "gif")
```
header_ani.tex
\usepackage{animate}
Problem
Warning: Ignoring unknown aesthetics: frame
Quitting from lines 20-25 (second_animation.Rmd) Error: Could not find ffmpeg command. You should either change the animation.fun hook option or install ffmpeg with libvpx enabled. Execution halted
Notes
Why the reference to ffmpeg. According to the knitr documentation:
When the chunk option fig.show='animate' and there are multiple plots produced from a code chunk, all plots will be combined to an animation. For LaTeX output, the LaTeX package animate is used to create animations in PDF. For HTML/Markdown output, by default FFmpeg is used to create a WebM video. Note you have to enable the libvpx support when installing FFmpeg. Linux and Windows users can just follow the download links on the FFmpeg website (libvpx has been enabled in the binaries). For OS X users, you can install FFmpeg via Homebrew
ffmpeg should be used in conversion to html. Is it because of the RMarkdown's pipeline?
that forces use of ffmpeg somewhere along the line?
Question
Is it possible to make use of the animate package in a RMarkdown document and avoid ffmpeg so the obtained PDF has the following component with conrtols offred by the animate package.
(Not the chart I want to generate but shows how the animated graphic should be embedded in the PDF, taken from the animate package documentation referenced above.)