Reppo for internal functions.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.3 KiB

  1. \name{ggcorrplot}
  2. \alias{ggcorrplot}
  3. \title{ggcorrplot}
  4. \usage{
  5. ggcorrplot(df, var, value, color="#FFFFFF00", stat="signif", tri="all", method="pearson")
  6. }
  7. \arguments{
  8. \item{df}{A data frame in "long" format.}
  9. \item{var}{The column that will be used to analyze correlation all against all.}
  10. \item{value}{The column that will be used as numeric data to analyze correlation.}
  11. \item{color}{The color of the lines of geom_tile (the border). By default, its transparent.}
  12. \item{stat}{The stats that will be on the tiles. They can be "signif", "pval", "none". By default, it presents "signif" (stars representing pvalue).}
  13. \item{tri}{It specifies which half of the correlation matrix is shown. Can be "all" (the default), "upper" or "lower".}
  14. \item{method}{Method for correlation. It will be passed to "cor" and "rcorr" functions, "pearson" by default.}
  15. }
  16. \description{
  17. Generates a correlation matrix using ggplot for a dataframe.
  18. }
  19. \examples{
  20. library(tidyverse)
  21. df<-data.frame("pats"=paste0("PAT", 1:20), "CytA"=rnorm(20,5), "CytB"=rnorm(20,5),
  22. "CytC"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytD"=rnorm(20,5),
  23. "CytE"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytF"=rnorm(20,5),
  24. "CytG"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)))
  25. df<-gather(df, Cyt, Value,-pats)
  26. head(df)
  27. ggcorrplot(df, Cyt, Value)
  28. }