|
\name{ggheatmap}
|
|
\alias{ggheatmap}
|
|
\title{ggheatmap}
|
|
\usage{
|
|
ggheatmap(df, x=NULL, y=NULL, value=NULL, grouping="mean", exclude_group=NULL, scale="none", color="#FFFFFF00")
|
|
}
|
|
\arguments{
|
|
\item{df}{A data frame in "long" format.}
|
|
\item{x}{The variable that will be used for X axis in the heatmap. If not specified, the first column will be used.}
|
|
\item{y}{The variable that will be used for Y axis in the heatmap. If not specified, the second column will be used.}
|
|
\item{value}{The variable that will be used for colouring the heatmap. If not specified, the third column will be used.}
|
|
\item{grouping}{The function that will be used to group if there is more than one observation for each X-Y combination. "mean" or "median" are posible, defaulting to "mean".}
|
|
\item{exclude_group}{If you want to exclude columns from grouping, you can introduce a character vector here. Useful if you want to facet the plot.}
|
|
\item{scale}{Escales (z-score) by "rows" or "cols" if diferent of "none" (default).}
|
|
\item{color}{The color of the lines of geom_tile (the border). By default, its transparent.}
|
|
}
|
|
\description{
|
|
Generates a heatmap 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)
|
|
|
|
ggheatmap(df)
|
|
}
|