figasaur: Encode plot commands into a plot file

Description Usage Arguments Author(s) Examples

View source: R/figasaur.R

Description

The code supplied in code (typially in curly braces) is used to create a figure which has the plotting code encoded as a character string in the file. This information can be extracted using decode.

Usage

1
figasaur(code, filename, ...)

Arguments

code

code use to produce the figure you want

filename

name of the file to write

...

extra arguments to go to png

Author(s)

David L Miller

Examples

1
2
3
4
5
6
# encode the code in the curly braces into its corresponding plot
path <- tempfile(fileext = ".png")
figasaur({plot(sample(100))}, path)

# extract the information
cat(decode(path))

richfitz/stegasaur documentation built on Feb. 12, 2021, 1:41 a.m.