Commit ad760718 authored by houyun's avatar houyun
Browse files

delete set_pairs_scale

parent 26cda185
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ S3method(ggplot_add,geom_ggplot)
S3method(ggplot_add,geom_pairs)
S3method(ggplot_add,geom_panel_grid)
S3method(ggplot_add,magic_text)
S3method(ggplot_add,pairs_scale)
S3method(ggplot_add,secondary_axis)
S3method(ggplot_build,gggplot)
S3method(guide_gengrob,guide_child)
@@ -158,7 +157,6 @@ export(secondary_x_axis)
export(secondary_y_axis)
export(set_corrplot_style)
export(set_default_style)
export(set_pairs_scale)
export(set_secondary_axis)
export(suffix_with)
export(theme_hy)
+0 −35
Original line number Diff line number Diff line
@@ -1206,38 +1206,3 @@ GeomCorr <- ggproto(
  draw_key = ggplot2::draw_key_point
)
#' @title Set aesthestic scale
#' @description Before drawing, you can set the scale function for each plot of pairs.
#' @param ... scale object.
#' @param ID specify the ID of the element plot that you want to add.
#' @return a ggplot.
#' @rdname set_pairs_scale
#' @author Hou Yun
#' @export
set_pairs_scale <- function(..., ID = NULL) {
  structure(list(ID = ID, params = list(...)), class = "pairs_scale")
}

#' @export
ggplot_add.pairs_scale <- function(object, plot, object_name) {
  if (!inherits(plot, "qpairs")) {
    warning("`set_pairs_scale()` can only be added to qpairs plot.", call. = FALSE)
    return(plot)
  }
  data <- plot$data
  if (empty(data)) return(plot)

  if (is.null(object$ID)) {
    id <- rep_len(TRUE, nrow(data))
  } else {
    id <- grepl(object$ID, data$ID)
  }

  if (all(isFALSE(id))) return(plot)

  for (ii in which(id)) {
    data$.plot[[ii]] <- data$.plot[[ii]] + object$params
  }
  plot$data <- data
  plot
}

man/set_pairs_scale.Rd

deleted100644 → 0
+0 −22
Original line number Diff line number Diff line
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/experimental-fun.R
\name{set_pairs_scale}
\alias{set_pairs_scale}
\title{Set aesthestic scale}
\usage{
set_pairs_scale(..., ID = NULL)
}
\arguments{
\item{...}{scale object.}

\item{ID}{specify the ID of the element plot that you want to add.}
}
\value{
a ggplot.
}
\description{
Before drawing, you can set the scale function for each plot of pairs.
}
\author{
Hou Yun
}