Animate image. Resulting file best viewed in Google Chrome.

image_animate(
  input,
  attribute = "opacity",
  values = c(0, 1, 0),
  duration = 10,
  openfile = TRUE,
  output = input
)

Arguments

input

File name of .svg file to input

attribute

Name of attribute. opacity is the default

values

Vector of values to go between. Defaults to c(0,1,0)

duration

Number of seconds for animation to last, defaults to 10 seconds

openfile

Open file in default program for .svg format. Defaults to FALSE.

output

File name of .svg file to output. Default is to overwrite the input file.

Value

output name

Examples

.old_wd <- setwd(tempdir()) library(spiro) spiro(fixed_radius = 3, cycling_radius = 1, file = "image_animate.svg") %>% image_animate(attribute = "opacity", duration = 2, values = c(0.3,0.9,0.3)) setwd(.old_wd)