savePlotInMultiFormats: Save Plot in multiple Formats

View source: R/savePlotInMultiFormats.R

savePlotInMultiFormatsR Documentation

Save Plot in multiple Formats

Description

Saves Plot as jpg, pdf, svg, eps the latter two for Adobe Illustrator or freeware Inkscape

Usage

savePlotInMultiFormats(
  corefilename,
  plotecode,
  weite = 7,
  hoehe = 7,
  mymfrow = c(1, 1),
  saveSVG = T,
  savePDF = T,
  saveEPS = T,
  saveJPG = T,
  jpg_res = 300
)

Arguments

corefilename

filename (optional incl. path) without .*** file extension

plotecode

Any code used for plotting a graphic, as String

weite

width in inches, Default: 7

hoehe

hight in inches, Default: 7

mymfrow

mfrow parameter, relevant for base graphic only, Default: c(1, 1)

saveSVG

save as SVG, Default: T

savePDF

save as PDF, Default: T

saveEPS

save as EPS, Default: T

saveJPG

save as JPEG, Default: T

jpg_res

REsoluation of Jpec, Default: 300

Details

DETAILS

Value

Files in the specified location

Examples

## Not run: 
if(interactive()){
 #EXAMPLE1
 data(cars)
 savePlotInMultiFormats("Carsplot", "plot(cars$speed ~ cars$dist)")

 #EXAMPLE1
 data(cars)
 require(ggplot2)
 p1 = ggplot(cars, aes(dist, speed)) + geom_point()
 savePlotInMultiFormats("Carsplot", 'plot(p1)')

 }

## End(Not run)

holgerman/toolboxH documentation built on June 25, 2022, 2:42 p.m.