R/labs.R

Defines functions labs_cyto

Documented in labs_cyto

#' Change axis labels and legend titles
#'
#' The actual labels text will be instantiated when it is added to ggcyto plot.
#'
#' @param labels default labels for x, y axis. Can be "channel" , "marker", or "both" (default)
#' @export
#' @return a list 
#' @examples
#' 
#' dataDir <- system.file("extdata",package="flowWorkspaceData")
#' gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE))
#' 
#' # default is "both"
#' p <- ggcyto(gs, aes(x = CD4, y = CD8), subset = "CD3+") + geom_hex(bins = 64)
#' p
#' 
#' #use marker name as x,y labs
#' p + labs_cyto("marker")
#' 
#' #use channel name as x,y labs
#' p + labs_cyto("channel")
labs_cyto <- function(labels = "both") {
  
  structure(list(labels = labels), class = "labs_cyto")
}

Try the ggcyto package in your browser

Any scripts or data that you put into this service are public.

ggcyto documentation built on Nov. 8, 2020, 5:30 p.m.