ParsePlot: Parse Plot

Description Usage Arguments See Also Examples

Description

Display and/or save plots

Usage

1
2
3
4
5
6
ParsePlot(plot.data, project.dir = "Results/",
  project.name = FileName(name = "Print"), graphic.type = "pdf",
  plot.size = "15,10", scaling = 100, plot.aspect = NULL,
  save.data = FALSE, vector.graphic = FALSE, point.size = 12,
  font.type = "serif", one.file = TRUE, ppi = 300, units = "in",
  layout = "a4", layout.inverse = FALSE, return.files = FALSE, ...)

Arguments

plot.data

a list of plots

project.dir

define where to save data, Default: 'Results/'

project.name

define name of project, Default: 'FileName(name="Print")'

graphic.type

type of graphics to use (e.g., pdf, png, ps), Default: 'pdf'

plot.size

size of plot, Default: '15,10'

scaling

scale size of plot, Default: 100

plot.aspect

aspect of plot, Default: NULL

save.data

logical, indicating whether or not to save data, Default: FALSE

vector.graphic

logical, indicating whether or not visualizations should be vector or raster graphics, Default: FALSE

point.size

point size used for visualizations, Default: 12

font.type

font type used for visualizations, Default: 'serif'

one.file

logical, indicating whether or not visualizations should be placed in one or several files, Default: TRUE

ppi

define pixel per inch used for visualizations, Default: 300

units

define unit of length used for visualizations, Default: 'in'

layout

define a layout size for visualizations, Default: 'a4'

layout.inverse

logical, indicating whether or not to inverse layout (e.g., landscape) , Default: FALSE

return.files

logical, indicating whether or not to return saved file names

...

further arguments passed to or from other methods

See Also

dev,png,ps.options,recordPlot head readPNG par,plot,rasterImage read_pptx,add_slide,ph_with_img ph_with_vg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Create three plots
plot.data <- lapply(1:3, function (i) {
  # Open new device
  grDevices::dev.new()
  # Print plot
  plot(1:i)
  # Record plot
  p <- grDevices::recordPlot()
  # Turn off graphics device drive
  grDevices::dev.off()
  return (p)
} )

# Print plots
ParsePlot(plot.data)

# Save plots as png with a4 layout and return file names
project.dir <- tempdir()
project.name <- FileName(name="Testing-Plot")
ParsePlot(plot.data,
          project.dir = project.dir,
          project.name = project.name,
          graphic.type = "png",
          save.data = TRUE,
          layout = "a4",
          return.files = TRUE
)
# [1] "\\Temp/Project-Testing-Plot01-1528833217.png"
# [2] "\\Temp/Project-Testing-Plot02-1528833217.png"
# [3] "\\Temp/Project-Testing-Plot03-1528833217.png"
# Save plots as single PowerPoint (default) and return file names
project.dir <- tempdir()
project.name <- FileName(name="Testing-Plot")
ParsePlot(plot.data,
          project.dir = project.dir,
          project.name = project.name,
          vector.graphic = FALSE,
          graphic.type = "pptx",
          layout = "pw",
          save.data = TRUE,
          return.files = TRUE
)
# [1] "\\Temp/Project-Testing-Plot-1528833342.pptx"

bfw documentation built on May 2, 2019, 6:51 a.m.