export: Export timing schemes to JSON

Description Usage Arguments Value Author(s) Examples

View source: R/export.R

Description

There are forms of animation that are simply not possible to do with R graphics. In order to use the same timing information in another graphics system we export timing schemes to JSON, a simple and convenient data exchange format.

Usage

1
2
3
4
5
6
7
export(x, jsVar = "timingData", file = "timingData.js")

## S3 method for class 'anim'
export(x, jsVar = "timingData", file = "timingData.js")

## S3 method for class 'timing'
export(x, jsVar = "timingData", file = "timingData.js")

Arguments

x

An animation object or a timing object.

jsVar

A character vector. The JavaScript variable that the resulting JSON is assigned to. If NULL or "", do not assign to a variable.

file

A character vector naming the file to save the JSON to. If this is NULL or "" the JSON is returned as a character vector instead of being saved to a file.

Value

By default, none. If file is NULL or "", a character vector.

Author(s)

Simon Potter.

Examples

1
2
3
4
5
a <- atomic(start = 2, durn = 4, label = "a")
b <- atomic(durn = 3, label = "b")
v <- vec(a, b)
export(timing(v), jsVar = "vTiming")
export(v, jsVar = "vTiming", file = "animTiming.js")

pmur002/animaker documentation built on May 25, 2019, 10:20 a.m.