Last data update: 2014.03.03

R: overloaded '+' method for ggcyto
+.ggcyto_flowSetR Documentation

overloaded '+' method for ggcyto

Description

It tries to copy pData from ggcyto object to the gate layers so that the gate layer does not need to have 'pd' to be supplied explicitly by users. It also calculates population statistics when geom_stats layer is added. It supports addition ggcyto layers such as 'ggcyto_par' and 'labs_cyto'.

Usage

## S3 method for class 'ggcyto_flowSet'
e1 + e2

## S4 method for signature 'ggcyto_flowSet,ANY'
e1 + e2

Arguments

e1

An object of class ggcyto_flowSet

e2

A component to add to e1

Value

ggcyto_flowSet object

Examples

data(GvHD)
fs <- GvHD[subset(pData(GvHD), Patient %in%5:7 & Visit %in% c(5:6))[["name"]]]
p <- ggcyto(fs, aes(x = `FSC-H`, y =  `SSC-H`)) + geom_hex(bins = 128)
#add rectangleGate layer (2d)
rect.g <- rectangleGate(list("FSC-H" =  c(300,500), "SSC-H" = c(50,200)))
rect.gates <- sapply(sampleNames(fs), function(sn)rect.g)
p + geom_gate(rect.gates) + geom_stats()

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ggcyto)
Loading required package: ggplot2
Loading required package: flowCore
Loading required package: ncdfFlow
Loading required package: flowViz
Loading required package: lattice
Loading required package: RcppArmadillo
Loading required package: BH
Loading required package: flowWorkspace
Loading required package: gridExtra
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/ggcyto/ggcyto_flowSet_add.Rd_%03d_medium.png", width=480, height=480)
> ### Name: +.ggcyto_flowSet
> ### Title: overloaded '+' method for ggcyto
> ### Aliases: +,ggcyto_flowSet,ANY-method +.ggcyto_flowSet
> 
> ### ** Examples
> 
> data(GvHD)
> fs <- GvHD[subset(pData(GvHD), Patient %in%5:7 & Visit %in% c(5:6))[["name"]]]
> p <- ggcyto(fs, aes(x = `FSC-H`, y =  `SSC-H`)) + geom_hex(bins = 128)
> #add rectangleGate layer (2d)
> rect.g <- rectangleGate(list("FSC-H" =  c(300,500), "SSC-H" = c(50,200)))
> rect.gates <- sapply(sampleNames(fs), function(sn)rect.g)
> p + geom_gate(rect.gates) + geom_stats()
Warning message:
Removed 257 rows containing missing values (geom_hex). 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>