R/add_ggplot.R

Defines functions plot_clone

# taken from ggplot2:::* to avoid r cmd check note on using :::

add_ggplot <- function (p, object, objectname) 
{
  if (is.null(object)) 
    return(p)
  p <- plot_clone(p)
  p <- ggplot_add(object, p, objectname)
  set_last_plot(p)
  p
}

plot_clone <- function(plot) {
  p <- plot
  p$scales <- plot$scales$clone()

  p
}

Try the ggedit package in your browser

Any scripts or data that you put into this service are public.

ggedit documentation built on July 8, 2020, 5:34 p.m.