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.

31 lines
1.5 KiB

  1. \name{ggheatmap}
  2. \alias{ggheatmap}
  3. \title{ggheatmap}
  4. \usage{
  5. ggheatmap(df, x=NULL, y=NULL, value=NULL, grouping="mean", exclude_group=NULL, scale="none", color="#FFFFFF00")
  6. }
  7. \arguments{
  8. \item{df}{A data frame in "long" format.}
  9. \item{x}{The variable that will be used for X axis in the heatmap. If not specified, the first column will be used.}
  10. \item{y}{The variable that will be used for Y axis in the heatmap. If not specified, the second column will be used.}
  11. \item{value}{The variable that will be used for colouring the heatmap. If not specified, the third column will be used.}
  12. \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".}
  13. \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.}
  14. \item{scale}{Escales (z-score) by "rows" or "cols" if diferent of "none" (default).}
  15. \item{color}{The color of the lines of geom_tile (the border). By default, its transparent.}
  16. }
  17. \description{
  18. Generates a heatmap using ggplot for a dataframe.
  19. }
  20. \examples{
  21. library(tidyverse)
  22. df<-data.frame("pats"=paste0("PAT", 1:20), "CytA"=rnorm(20,5), "CytB"=rnorm(20,5),
  23. "CytC"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytD"=rnorm(20,5),
  24. "CytE"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)),"CytF"=rnorm(20,5),
  25. "CytG"=c(rnorm(5,10),rnorm(5,5),rnorm(5,10),rnorm(5,5)))
  26. df<-gather(df, Cyt, Value,-pats)
  27. head(df)
  28. ggheatmap(df)
  29. }