Description Usage Arguments Value Examples
This function is a wrapper around ggsave()
that uses pre-specified values which
correspond to the possible graphics sizes in my lecture and presentation slides.
1 | cp_plotSave(filename, plot, device = "png", preset = c("sm", "med", "lg"), dpi = 300)
|
filename |
File name to create on disk; must be quoted |
plot |
Plot to save, defaults to last plot displayed if no plot included |
device |
Device to use. Can be either be a device function (e.g. |
preset |
Preset size ("sm", "med", "lg") |
dpi |
Dots per inch for plot |
Saves a file to the disk in the pre-determined size. preset = "sm"
1 2 3 4 5 6 7 8 | ## Not run:
p <- ggplot(mpg, aes(hwy)) + geom_histogram()
cp_plotSave("hwy.png", preset = "sm")
cp_plotSave("hwy.png", p, preset = "med")
cp_plotSave("hwy.png", p, preset = "lg")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.