tofigure {eoffice}R Documentation

output figures to different formats

Description

output figures to different formats

Usage

tofigure(figure, format = NULL, filename = "temp.pdf")

Arguments

figure

output figure function, set NULL output the current figure

format

output format (could be ingored)

filename

output filename with different format as suffix

Author(s)

Kai Guo

Examples

require(ggplot2)
p <- ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point()
tofigure(p,filename = file.path(tempdir(), "mtcars.pdf"))
## or use ggplot directly
tofigure(ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) +
geom_point(), filename = file.path(tempdir(), "mtcars.eps"))

## if you use basic plot function or other plot function you
## need first use convertplot to convert it to ggplot object
## when you are working on the platform without GUI
p <- convertplot(plot(1:10))
tofigure(p, filename = file.path(tempdir(), "mtcars.pdf"))
topptx(p, filename = file.path(tempdir(), "mtcars.pptx"))


[Package eoffice version 0.2.2 Index]