Learn R Programming

ggcyto (version 1.0.5)

+.ggcyto_flowSet: 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

"+"(e1, e2)
"+"(e1, e2)

Arguments

e1
An object of class ggcyto_flowSet
e2
A component to add to e1

Value

ggcyto_flowSet object

Examples

Run this code
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()

Run the code above in your browser using DataLab