Commit 8f46c83d authored by houyun's avatar houyun
Browse files

can reset pairs plot

parent 28d461a1
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -234,13 +234,15 @@ ggplot_add.geom_pairs <- function(object, plot, object_name) {
#' @param ... any valid layer parameters.
#' @param scale a list of aesthestic scale.
#' @param ptype a plot_type object, which can be created by `plot_type()`.
#' @param reset logical, if TRUE will reset pairs plot parameters.
#' @return set global options and return NULL.
#' @author Hou Yun
#' @rdname register_pairs_plot
#' @export
register_pairs_plot <- function(...,
                                ptype = NULL,
                                scale = list()) {
                                scale = list(),
                                reset = FALSE) {
  layers <- list("point" = ggplot2::geom_point(),
                 "histogram" = ggplot2::geom_histogram(aes_string(y = "..count..")),
                 "bar" = ggplot2::geom_bar(),
@@ -256,6 +258,10 @@ register_pairs_plot <- function(...,
                 "blank" = ggplot2::geom_blank(),
                 "jitter" = ggplot2::geom_jitter(),
                 "corr" = geom_corr())
  if (isTRUE(reset)) {
    options("linkET.pairs.plot" = layers)
    return(invisible(NULL))
  }
  gl <- options("linkET.pairs.plot")$linkET.pairs.plot

  if (!is.list(scale)) {
+3 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
\alias{register_pairs_plot}
\title{Register pairs plot}
\usage{
register_pairs_plot(..., ptype = NULL, scale = list())
register_pairs_plot(..., ptype = NULL, scale = list(), reset = FALSE)
}
\arguments{
\item{...}{any valid layer parameters.}
@@ -12,6 +12,8 @@ register_pairs_plot(..., ptype = NULL, scale = list())
\item{ptype}{a plot_type object, which can be created by `plot_type()`.}

\item{scale}{a list of aesthestic scale.}

\item{reset}{logical, if TRUE will reset pairs plot parameters.}
}
\value{
set global options and return NULL.