drawExport: Export Current Drawing Page to a File

Description Usage Arguments Value See Also Examples

Description

Export Current Drawing Page to a File

Usage

1
2
3
drawExport(f, width = .pkgenv$pageWidth, height = .pkgenv$pageHeight,
  ppi = .pkgenv$exportPPI, format = tools::file_ext(f),
  textSize = .pkgenv$textSize, units = .pkgenv$exportUnits, ...)

Arguments

f

Character value of the file path to save to. Must include file name and extension.

width

Numeric value of the image width.

height

Numeric value of the image height.

ppi

Numeric value of the image resolution quality in Pixels Per Inch (PPI).

format

Character value of the extension for file without a period ".".

textSize

Size of text (pt) in image.

units

Character value for the unit to use when specifying measurements. Can be one of the following:

  • "px", "pixels", "pixel", "pix"

  • "in", "inches", "inch"

  • "cm", "centimeters", "centimeter", "centimetre", "centimetres"

  • "mm", "millimeters", "millimeter", "millimetre", "millimetres"

...

Additional arguments passed to dev.copy.

Value

The name and number of the device, according to dev.copy, which has been copied to.

See Also

drawSettings

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(draw)

# Set drawing settings
drawSettings(pageWidth = 5, pageHeight = 5, units = "inches")

# Create a new drawing page
drawPage()

# Draw a square
drawBox(x = 1, y = 4, width = 2, height = 2)

# Export the drawing page to a PDF
drawExport("export.pdf")

# Export the drawing page to a PNG
drawExport("export.png", ppi=300)

rrwen/draw documentation built on May 10, 2019, 1:52 a.m.