Learn R Programming

spork (version 0.1.1)

as_previews.spork: Compare Previews of Spork

Description

Compares plotmath and latex previews of spork Generates png for both, and overlays latex above plotmath.

Usage

# S3 method for spork
as_previews(x, wide = 70, long = 20, width = 3, height = 1, ...)

Arguments

x

length-one spork

wide

width in mm of the latex image

long

length in mm of the latex image

width

width (default: inches) of the plotmath image

height

height (default: inches) of the plotmath image

...

passed arguments

Value

invisible list of filepaths

See Also

Other preview: as.png.plotmath(), as.png.spork(), as_preview.latex(), as_preview.plotmath(), as_previews(), as_preview(), ggplot.plotmath(), ggplot.spork()

Examples

Run this code
# NOT RUN {
library(magrittr)
specials <- '& % $ # \\_ { } ~ \\^ \\'
# }
# NOT RUN {
specials %>% as_spork %>% as_previews
specials %>% gsub(' ','',.) %>% as_spork %>% as_previews
'one joule (Omega) ~ 1 kg*m^2./s^2' %>% as_spork %>% as_previews

# disambiguation for plotmath and latex (see \code{\link[grDevices]{plotmath}}):

'epsilon.varepsilon' %>% as_spork %>% as_previews
'rho.varrho' %>% as_spork %>% as_previews
'Upsilon.Upsilon1' %>% as_spork %>% as_previews
'phi.phi1.varphi' %>% as_spork %>% as_previews
'sigma.sigma1.varsigma.stigma' %>% as_spork %>% as_previews
'theta.vartheta.theta1' %>% as_spork %>% as_previews
'omega.omega1.pi.varpi' %>% as_spork %>% as_previews
# }

Run the code above in your browser using DataLab