Commit fc45c368 authored by houyun's avatar houyun
Browse files

clean document

parent ec9c0deb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ Depends: R (>= 3.5.0)
Imports: 
    digest,
    dplyr, 
    geomtextpath,
    ggplot2 (>= 3.0.0), 
    glue, 
    grDevices,
+0 −46
Original line number Diff line number Diff line
# Generated by roxygen2: do not edit by hand

S3method("[",marker)
S3method(as_correlate,corr.test)
S3method(as_correlate,data.frame)
S3method(as_correlate,matrix)
S3method(as_correlate,rcorr)
S3method(as_matrix_data,corr.test)
S3method(as_matrix_data,correlate)
S3method(as_matrix_data,data.frame)
S3method(as_matrix_data,default)
S3method(as_matrix_data,grouped_correlate)
S3method(as_matrix_data,matrix)
S3method(as_matrix_data,rcorr)
S3method(as_md_tbl,corr.test)
S3method(as_md_tbl,correlate)
S3method(as_md_tbl,data.frame)
S3method(as_md_tbl,easycorrelation)
S3method(as_md_tbl,grouped_correlate)
S3method(as_md_tbl,grouped_matrix_data)
S3method(as_md_tbl,mantel_tbl)
S3method(as_md_tbl,matrix)
S3method(as_md_tbl,matrix_data)
S3method(as_md_tbl,md_tbl)
S3method(as_md_tbl,pro_tbl)
S3method(as_md_tbl,rcorr)
S3method(c,marker)
S3method(get_order,character)
S3method(get_order,dendrogram)
@@ -44,15 +22,6 @@ S3method(guide_train,guide_child)
S3method(guide_transform,guide_child)
S3method(length,marker)
S3method(makeContent,markerGrob)
S3method(marker,"magick-image")
S3method(marker,character)
S3method(marker,formula)
S3method(marker,gList)
S3method(marker,ggplot)
S3method(marker,grob)
S3method(marker,list)
S3method(marker,marker)
S3method(marker,raster)
S3method(plot,gggplot)
S3method(print,calc_relimp)
S3method(print,correlate)
@@ -63,26 +32,19 @@ S3method(print,hyplot)
S3method(print,marker)
S3method(print,matrix_data)
S3method(print,random_forest)
S3method(qcorrplot,cor_md_tbl)
S3method(qcorrplot,data.frame)
S3method(qcorrplot,default)
S3method(qcorrplot,matrix)
S3method(rep_len,marker)
export("%>%")
export("col_names<-")
export("row_names<-")
export(DoughnutGrob)
export(GeomCorr)
export(GeomCurve2)
export(GeomDoughnut)
export(GeomHalfcircle)
export(GeomMark)
export(GeomSquare)
export(Geomshaping)
export(aes)
export(anno_link)
export(as.igraph)
export(as_correlate)
export(as_matrix_data)
export(as_md_tbl)
export(as_tbl_graph)
@@ -95,7 +57,6 @@ export(contain_with)
export(correlate)
export(dist_func)
export(draw_key_marker)
export(dudi_pca)
export(extract_diag)
export(extract_lower)
export(extract_upper)
@@ -105,11 +66,9 @@ export(filter_func)
export(gdist)
export(geom_corr)
export(geom_couple)
export(geom_curve2)
export(geom_diag_label)
export(geom_doughnut)
export(geom_ggplot)
export(geom_halfcircle)
export(geom_magic_text)
export(geom_mark)
export(geom_node_doughnut)
@@ -131,13 +90,11 @@ export(make_cluster)
export(mantel_test)
export(marker)
export(matrix_data)
export(mono_mds)
export(ncols)
export(nice_curvature)
export(nrows)
export(plot_type)
export(prefix_with)
export(procrutes_test)
export(qcorrplot)
export(qpairs)
export(rand_correlate)
@@ -164,7 +121,6 @@ export(trim_diag)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,mutate)
importFrom(geomtextpath,GeomTextpath)
importFrom(ggplot2,Geom)
importFrom(ggplot2,GeomCurve)
importFrom(ggplot2,GeomPoint)
@@ -238,7 +194,6 @@ importFrom(igraph,as.igraph)
importFrom(igraph,graph_from_data_frame)
importFrom(igraph,vertex_attr)
importFrom(magrittr,"%>%")
importFrom(purrr,map)
importFrom(purrr,map_dbl)
importFrom(purrr,pmap)
importFrom(purrr,pmap_dfr)
@@ -258,7 +213,6 @@ importFrom(stats,na.exclude)
importFrom(stats,p.adjust)
importFrom(stats,p.adjust.methods)
importFrom(stats,runif)
importFrom(stats,setNames)
importFrom(tibble,as_tibble)
importFrom(tibble,tibble)
importFrom(tidygraph,as_tbl_graph)
+0 −5
Original line number Diff line number Diff line
@@ -7,14 +7,12 @@
#' @param ... others parameters.
#' @return a correlate object.
#' @rdname as_correlate
#' @export
as_correlate <- function(x, ...) {
  UseMethod("as_correlate")
}

#' @method as_correlate rcorr
#' @rdname as_correlate
#' @export
as_correlate.rcorr <- function(x, ...) {
  p <- x$P
  diag(p) <- 0
@@ -23,14 +21,12 @@ as_correlate.rcorr <- function(x, ...) {

#' @method as_correlate corr.test
#' @rdname as_correlate
#' @export
as_correlate.corr.test <- function(x, ...) {
  structure(.Data = list(r = x$r, p = x$p), class = "correlate")
}

#' @method as_correlate matrix
#' @rdname as_correlate
#' @export
as_correlate.matrix <- function(x,
                                is_corr = NULL,
                                p = NULL,
@@ -55,7 +51,6 @@ as_correlate.matrix <- function(x,

#' @method as_correlate data.frame
#' @rdname as_correlate
#' @export
as_correlate.data.frame <- function(x, ...) {
  as_correlate(as.matrix(x), ...)
}
+0 −7
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@ as_matrix_data <- function(x, ...)
}

#' @rdname as_matrix_data
#' @export
#' @method as_matrix_data matrix
as_matrix_data.matrix <- function(x,
                                  name = NULL,
@@ -32,7 +31,6 @@ as_matrix_data.matrix <- function(x,

#' @param include one of "numeric" (default), "character" or "factor".
#' @rdname as_matrix_data
#' @export
#' @method as_matrix_data data.frame
as_matrix_data.data.frame <- function(x,
                                      name = NULL,
@@ -53,7 +51,6 @@ as_matrix_data.data.frame <- function(x,
}

#' @rdname as_matrix_data
#' @export
#' @method as_matrix_data correlate
as_matrix_data.correlate <- function(x,
                                     extra_mat = list(),
@@ -72,7 +69,6 @@ as_matrix_data.correlate <- function(x,
}

#' @rdname as_matrix_data
#' @export
#' @method as_matrix_data grouped_correlate
as_matrix_data.grouped_correlate <- function(x,
                                             extra_mat = list(),
@@ -95,7 +91,6 @@ as_matrix_data.grouped_correlate <- function(x,
}

#' @rdname as_matrix_data
#' @export
#' @method as_matrix_data rcorr
as_matrix_data.rcorr <- function(x,
                                 extra_mat = list(),
@@ -105,7 +100,6 @@ as_matrix_data.rcorr <- function(x,
}

#' @rdname as_matrix_data
#' @export
#' @method as_matrix_data corr.test
as_matrix_data.corr.test <- function(x,
                                     extra_mat = list(),
@@ -115,7 +109,6 @@ as_matrix_data.corr.test <- function(x,
}

#' @rdname as_matrix_data
#' @export
#' @method as_matrix_data default
as_matrix_data.default <- function(x, ...)
{
+10 −34
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ as_md_tbl <- function(x, ...) {

#' @method as_md_tbl matrix_data
#' @rdname as_md_tbl
#' @export
as_md_tbl.matrix_data <- function(x, ...)
{
  type <- attr(x, "type")
@@ -50,7 +49,6 @@ as_md_tbl.matrix_data <- function(x, ...)

#' @method as_md_tbl grouped_matrix_data
#' @rdname as_md_tbl
#' @export
as_md_tbl.grouped_matrix_data <- function(x, ...)
{
  type <- vapply(x, attr, character(1), "type")
@@ -92,33 +90,8 @@ as_md_tbl.grouped_matrix_data <- function(x, ...)
            class = clss)
}

#' @method as_md_tbl pro_tbl
#' @rdname as_md_tbl
#' @export
as_md_tbl.pro_tbl <- function(x, byrow = TRUE, ...) {
  class(x) <- class(x)[-1L]
  grouped <- attr(x, "grouped")
  spec <- env <- NULL
  if(isTRUE(byrow)) {
    x <- as_md_tbl(x,
                   row_vars = spec,
                   col_vars = env,
                   is_corr = TRUE)
  } else {
    x <- as_md_tbl(x,
                   row_vars = env,
                   col_vars = spec,
                   is_corr = TRUE)
  }
  if (isTRUE(grouped)) {
    class(x) <- c("cor_md_tbl", "grouped_md_tbl", "md_tbl", "tbl_df", "tbl", "data.frame")
  }
  x
}

#' @method as_md_tbl mantel_tbl
#' @rdname as_md_tbl
#' @export
as_md_tbl.mantel_tbl <- function(x, byrow = TRUE, ...) {
  class(x) <- class(x)[-1L]
  grouped <- attr(x, "grouped")
@@ -142,7 +115,6 @@ as_md_tbl.mantel_tbl <- function(x, byrow = TRUE, ...) {

#' @method as_md_tbl easycorrelation
#' @rdname as_md_tbl
#' @export
as_md_tbl.easycorrelation <- function(x,
                                      type = "full",
                                      diag = TRUE,
@@ -228,7 +200,6 @@ as_md_tbl.easycorrelation <- function(x,

#' @method as_md_tbl correlate
#' @rdname as_md_tbl
#' @export
as_md_tbl.correlate <- function(x, ...) {
  x <- as_md_tbl(as_matrix_data(x, ...))
  class(x) <- c("cor_md_tbl", class(x))
@@ -237,7 +208,6 @@ as_md_tbl.correlate <- function(x, ...) {

#' @method as_md_tbl grouped_correlate
#' @rdname as_md_tbl
#' @export
as_md_tbl.grouped_correlate <- function(x, ...) {
  x <- as_md_tbl(as_matrix_data(x, ...))
  class(x) <- c("cor_md_tbl", class(x))
@@ -246,7 +216,6 @@ as_md_tbl.grouped_correlate <- function(x, ...) {

#' @method as_md_tbl rcorr
#' @rdname as_md_tbl
#' @export
as_md_tbl.rcorr <- function(x, ...) {
  as_md_tbl(as_correlate(x), ...)
}
@@ -266,7 +235,6 @@ as_md_tbl.corr.test <- function(x, ...) {
#' @param p_vars variable name of p value column.
#' @method as_md_tbl data.frame
#' @rdname as_md_tbl
#' @export
as_md_tbl.data.frame <- function(x,
                                 name = NULL,
                                 row_vars = NULL,
@@ -332,7 +300,6 @@ as_md_tbl.data.frame <- function(x,

#' @method as_md_tbl matrix
#' @rdname as_md_tbl
#' @export
as_md_tbl.matrix <- function(x, ...) {
  x <- as.data.frame(x)
  as_md_tbl(x, ...)
@@ -340,8 +307,17 @@ as_md_tbl.matrix <- function(x, ...) {

#' @method as_md_tbl md_tbl
#' @rdname as_md_tbl
#' @export
as_md_tbl.md_tbl <- function(x, ...) {
  x
}

#' @method as_md_tbl md_tbl
#' @rdname as_md_tbl
as_md_tbl.default <- function(x, ...) {
  x <- tryCatch(as.matrix(x), error = function(e) {
    msg <- paste("Cannot convert a", class(x)[1L], "object to md_tbl.")
    stop(msg, call. = FALSE)
  })
  as_md_tbl(x, ...)
}
Loading