includeLatex: Include Animated Graphics.

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/animatoR-functions-knitr.R

Description

Provides a line to embed a stack of graphic frames into PDF file as animated graphics. It is an interface for LaTeX command \animategraphics from LaTeX package animate.

Usage

1
2
3
includeLatex(title = "", file = NA, scale = 0.5, poster = "first",
  every = 1, fps = 25, first = "", last = "", vspace = "0pt",
  other = "controls")

Arguments

title

character, obsolete.

file

character, the leftmost part of the file name that is common to all members of the sequence. If file is equal to NA, file will be constructed from the code graphics prefix and chunk label. See Note.

scale

numeric, scaling factor, See Note.

poster

character or numeric, ['first' | <num> | 'last' | 'none'] Specifies which frame to display and print if the animation is not activated. The first frame is shown by default. Thus 'poster' or 'poster=first' need not be explicitly set. A frame number <num> may as well be given; <num> is zero-based, that is, the first frame has number '0'. See Note.

every

numeric. Build animation from every 'every'th frame only. Skipped frames are discarded and not embedded into the document. See Note.

fps

numeric, the animation frame rate (frames per second). Assigning values less than zero results in an error. Default is 25. See Note.

first

numeric, first frame to use in animation. Special case is default character value "", equivalent to 1. See Note.

last

numeric, last frame to use in animation. Special case is default character value "", equivalent to last, unknown frame number. See Note.

vspace

character, vertical space (LaTeX style) for graph positioning. Default is "0pt", no additional space.

other

character, other parameters separated by coma and passed to LaTeX package animate See Note.

Value

prints and invisibly returns the LaTeX \animategraphics command.

Note

Arguments (except title and vspace) are used to communicate with LaTeX package animate. For details see documentation for the LaTeX package animate. Be aware that this is not the same as R package animation.

When used with Sweave or knitr, the argument file need not to be set and will be conveniently constructed from the graphical prefix and chunk label.

Argument vspace can be useful for raising the animation image on slides (e.g. beamer).

Author(s)

Andrej Blejec andrej.blejec@nib.si

See Also

animator, LaTeX package animate (https://www.ctan.org/pkg/animate), R package animation (https://cran.r-project.org/web/packages/animation).

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
includeLatex("Test animation")
includeLatex("Test animation",scale=0.5,poster="last",other="loop")
# To include from specific file with stacked frames ( e. g. 0 .. 99 )
# Useful to include animations that were prepared before and can
# be reused in another file
includeLatex(file="./figs/PreparedBefore",first=10,last=50)

## End(Not run)

ablejec/animatoR documentation built on Feb. 21, 2020, 10:09 p.m.