| cf_outputFigure | R Documentation |
Handle paginate automatically, save asynchronously with future
cf_outputFigure(
pl,
filename = NULL,
width = 16,
height = 10,
scale = 1,
units = c("cm", "mm", "in")[1],
dpi = 300,
limitsize = TRUE,
device = NULL,
heightrel = NULL,
FLAGFuture = TRUE,
FLAGoverwrite = TRUE,
...
)
pl |
plot like ggplot, potentially created with facet_grid_paginate or list of ggplots |
filename, width, height, scale, units, dpi, limitsize, device, ... |
see [ggplot2::ggsave()] |
FLAGFuture |
Export asynchronously with the future-package |
# importFrom ggplot2 plot_dev parse_dpi plot_dim
nothing
.tempdir = tempdir()
.currentdir <- getwd()
setwd(.tempdir)
library(conveniencefunctions)
# -------------------------------------------------------------------------#
# 1 Paginate ----
# -------------------------------------------------------------------------#
# Large facetted plot
pl <- ggplot(diamonds) +
geom_point(aes(carat, price), alpha = 0.1) +
facet_grid_paginate(color ~ clarity, ncol = 3, nrow = 3, page = 4)
# Basic stuff
n_pages(pl)
getPaginateInfo(pl)
plotlist <- cf_applyPaginate(pl)
length(plotlist)
# Asynchronous outputting
cf_outputFigure(pl, filename = "wup.png")
cf_outputFigure(pl, filename = "wupwup.pdf")
# Go to the files
try(system("nautilus .", wait = FALSE))
# Exit ----
setwd(.currentdir)
future::plan("sequential")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.