Commit af706ca4 authored by houyun's avatar houyun
Browse files

change use_md to parse

parent c4df0088
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -3,11 +3,11 @@
#' @param data one of 'correlate', 'rcorr' or 'corr.test' object.
#' @param mapping default list of aesthetic mappings to use for plot.
#' @param drop logical, if TRUE will drop unused axis labels.
#' @param parse logical or function generated by \code{parse_func()}.
#' @param grid_col colour of panel grid.
#' @param grid_size size of panel grid.
#' @param fixed if TRUE (default), will add \code{coord_fixed()} to plot.
#' @param use_md logical. if TRUE, will use \code{ggtext::element_markdown()} to
#' draw the axis labels.
#' @param use_md deprecated.
#' @param facets NULL or a parameters list of \code{facet_wrap}.
#' @param facets_order character vector to set the order of facet panels.
#' @param ... other parameters.
@@ -34,12 +34,13 @@ qcorrplot <- function(data, ...) {
qcorrplot.cor_md_tbl <- function(data,
                                 mapping = NULL,
                                 drop = FALSE,
                                 parse = FALSE,
                                 grid_col = "grey50",
                                 grid_size = 0.25,
                                 fixed = TRUE,
                                 use_md = NULL,
                                 facets = list(),
                                 facets_order = NULL,
                                 use_md,
                                 ...) {
  if("p" %in% names(data)) {
    base_mapping <- aes_(fill = ~r, r = ~r, r0 = ~r, pvalue = ~p)
@@ -50,7 +51,7 @@ qcorrplot.cor_md_tbl <- function(data,
  p <- hyplot(md = data,
              mapping = aes_modify(base_mapping, mapping),
              drop = drop,
              use_md = use_md,
              parse = parse,
              facets = facets,
              facets_order = facets_order)

@@ -75,16 +76,18 @@ qcorrplot.cor_md_tbl <- function(data,
qcorrplot.matrix <- function(data,
                             mapping = NULL,
                             drop = FALSE,
                             parse = FALSE,
                             grid_col = "grey50",
                             grid_size = 0.25,
                             fixed = TRUE,
                             use_md = NULL,
                             facets = list(),
                             use_md,
                             ...) {
  data <- as_correlate(data)
  qcorrplot(data = data,
            mapping = mapping,
            drop = drop,
            parse = parse,
            grid_col = grid_col,
            grid_size = grid_size,
            fixed = fixed,
@@ -98,20 +101,21 @@ qcorrplot.matrix <- function(data,
qcorrplot.data.frame <- function(data,
                                 mapping = NULL,
                                 drop = FALSE,
                                 parse = FALSE,
                                 grid_col = "grey50",
                                 grid_size = 0.25,
                                 fixed = TRUE,
                                 use_md = NULL,
                                 facets = list(),
                                 use_md,
                                 ...) {
  data <- as_correlate(data)
  qcorrplot(data = data,
            mapping = mapping,
            drop = drop,
            parse = parse,
            grid_col = grid_col,
            grid_size = grid_size,
            fixed = fixed,
            use_md = use_md,
            facets = facets,
            ...)
}
@@ -121,21 +125,22 @@ qcorrplot.data.frame <- function(data,
qcorrplot.default <- function(data,
                              mapping = NULL,
                              drop = FALSE,
                              parse = FALSE,
                              grid_col = "grey50",
                              grid_size = 0.25,
                              fixed = TRUE,
                              use_md = NULL,
                              facets = list(),
                              facets_order = NULL,
                              use_md,
                              ...) {
  data <- as_md_tbl(data, ...)
  qcorrplot(data = data,
            mapping = mapping,
            drop = drop,
            parse = parse,
            grid_col = grid_col,
            grid_size = grid_size,
            fixed = fixed,
            use_md = use_md,
            facets = facets,
            facets_order = facets_order)
}
+12 −7
Original line number Diff line number Diff line
@@ -15,12 +15,13 @@ qcorrplot(data, ...)
  data,
  mapping = NULL,
  drop = FALSE,
  parse = FALSE,
  grid_col = "grey50",
  grid_size = 0.25,
  fixed = TRUE,
  use_md = NULL,
  facets = list(),
  facets_order = NULL,
  use_md,
  ...
)

@@ -28,11 +29,12 @@ qcorrplot(data, ...)
  data,
  mapping = NULL,
  drop = FALSE,
  parse = FALSE,
  grid_col = "grey50",
  grid_size = 0.25,
  fixed = TRUE,
  use_md = NULL,
  facets = list(),
  use_md,
  ...
)

@@ -40,11 +42,12 @@ qcorrplot(data, ...)
  data,
  mapping = NULL,
  drop = FALSE,
  parse = FALSE,
  grid_col = "grey50",
  grid_size = 0.25,
  fixed = TRUE,
  use_md = NULL,
  facets = list(),
  use_md,
  ...
)

@@ -52,12 +55,13 @@ qcorrplot(data, ...)
  data,
  mapping = NULL,
  drop = FALSE,
  parse = FALSE,
  grid_col = "grey50",
  grid_size = 0.25,
  fixed = TRUE,
  use_md = NULL,
  facets = list(),
  facets_order = NULL,
  use_md,
  ...
)
}
@@ -70,18 +74,19 @@ qcorrplot(data, ...)

\item{drop}{logical, if TRUE will drop unused axis labels.}

\item{parse}{logical or function generated by \code{parse_func()}.}

\item{grid_col}{colour of panel grid.}

\item{grid_size}{size of panel grid.}

\item{fixed}{if TRUE (default), will add \code{coord_fixed()} to plot.}

\item{use_md}{logical. if TRUE, will use \code{ggtext::element_markdown()} to
draw the axis labels.}

\item{facets}{NULL or a parameters list of \code{facet_wrap}.}

\item{facets_order}{character vector to set the order of facet panels.}

\item{use_md}{deprecated.}
}
\value{
a gg object.