Skip to content
/ draw Public

❗ This is a read-only mirror of the CRAN R package repository. draw — Wrapper Functions for Producing Graphics. Homepage: https://github.com/rrwen/draw Report bugs for this package: https://github.com/rrwen/draw/issues

License

Notifications You must be signed in to change notification settings

cran/draw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

draw

Richard Wen
rrwen.dev@gmail.com

User-friendly functions for creating consistent and reproducible graphics and diagrams with lines, common shapes, and text. Compatible with and based on the R 'grid' package.

Install

  1. Install R
  2. Install the RStudio code editor
  3. Open an R Console in RStudio
  4. Install draw in an R console with install.packages
install.packages("draw")

Usage

  1. Load draw with library
  2. Set page dimensions and units with drawSettings
  3. Create a new page with drawPage
  4. Draw graphics with drawBox, drawCircle, drawLine, drawText
  5. Export graphics to a file with drawExport
library(draw)

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

# Create a new drawing page
drawPage()

# Draw graphics on the page
drawBox(x = 2.5, y = 2.5, width = 1, height = 1)
drawCircle(x = 2.5, y = 2.5, radius = 0.5)
drawLine(x = c(1, 4),
         y = c(1 ,1))
drawText(x = 2.5, y = 2.5, text = "TEXT")

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

# Export the drawing page to a JPEG
drawExport("draw.jpeg", ppi = 300)

About

❗ This is a read-only mirror of the CRAN R package repository. draw — Wrapper Functions for Producing Graphics. Homepage: https://github.com/rrwen/draw Report bugs for this package: https://github.com/rrwen/draw/issues

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages