Compare commits

..

2 Commits

Author SHA1 Message Date
marcelcosta c7104d3903 Creado el man page para ggcorrplot. 2022-02-05 08:12:41 +01:00
marcelcosta 01addb00e5 Correction of example. 2022-02-05 08:01:40 +01:00
2 changed files with 34 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
\name{ggcorrplot}
\alias{ggcorrplot}
\title{ggcorrplot}
\usage{
ggcorrplot(df, var, color="#FFFFFF00", stat="signif", tri="all", method="pearson")
}
\arguments{
\item{df}{A data frame in "long" format.}
\item{var}{The column that will be used to analyze correlation all against all.}
\item{color}{The color of the lines of geom_tile (the border). By default, its transparent.}
\item{stat}{The stats that will be on the tiles. They can be "signif", "pval", "none". By default, it presents "signif" (stars representing pvalue).}
\item{tri}{It specifies which half of the correlation matrix is shown. Can be "all" (the default), "upper" or "lower".}
\item{method}{Method for correlation. It will be passed to "cor" and "rcorr" functions, "pearson" by default.}
}
\description{
Generates a correlation matrix using ggplot for a dataframe.
}
\examples{
library(tidyverse)
df<-data.frame("pats"=paste0("PAT", 1:20), "CytA"=rnorm(20,5), "CytB"=rnorm(20,5),
"CytC"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytD"=rnorm(20,5),
"CytE"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytF"=rnorm(20,5),
"CytG"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)))
df<-gather(df, Cyt, Value,-pats)
head(df)
ggcorrplot(df, Cyt)
}
+5 -1
View File
@@ -17,7 +17,11 @@ Generates a heatmap using ggplot for a dataframe.
\examples{ \examples{
library(tidyverse) library(tidyverse)
df<-data.frame("pats"=paste0("PAT", 1:20), "CytA"=rnorm(20,5), "CytB"=rnorm(20,5),"CytC"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytD"=rnorm(20,5),"CytE"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytF"=rnorm(20,5),"CytG"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5))) %>% gather(Cyt, Value,-pats) df<-data.frame("pats"=paste0("PAT", 1:20), "CytA"=rnorm(20,5), "CytB"=rnorm(20,5),
"CytC"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytD"=rnorm(20,5),
"CytE"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytF"=rnorm(20,5),
"CytG"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)))
df<-gather(df, Cyt, Value,-pats)
head(df) head(df)
ggheatmap(df) ggheatmap(df)