ggcyto-class {ggcyto} | R Documentation |
ggcyto()
initializes a ggcyto object that inherits ggplot class.
Similarly the + operator can be used to add layers to the
existing ggcyto object.
ggcyto(data = NULL, ...) ## Default S3 method: ggcyto(data = NULL, mapping = aes(), ...)
data |
The data source. A core cytometry data structure. (flowSet,flowFrame, GatingSet or GatingHierarchy) |
... |
other arguments passed to specific methods |
To invoke ggcyto
:
ggcyto(fs, aes(x, y, <other aesthetics>))
@return ggcyto object
data(GvHD) fs <- GvHD[1:3] #construct the `ggcyto` object (inherits from `ggplot` class) p <- ggcyto(fs, aes(x = `FSC-H`)) p + geom_histogram() # display density/area p + geom_density() p + geom_area(stat = "density") # 2d scatter plot p <- ggcyto(fs, aes(x = `FSC-H`, y = `SSC-H`)) p + geom_hex(bins = 128) # do it programatically through aes_string and variables col1 <- "`FSC-H`" #note that the dimension names with special characters needs to be quoted by backticks col2 <- "`SSC-H`" ggcyto(fs, aes_string(col1,col2)) + geom_hex()