flowCore (version 1.38.2)

fsApply: Apply a Function over values in a flowSet

Description

fsApply like many of the apply-style functions in R acts as an iterator for flowSet objects, allowing the application of a function to either the flowFrame or the data matrix itself. The output can the be reconstructed as either a flowSet, a list or a matrix depending on options and the type of objects returned.

Usage

fsApply(x, FUN, ..., simplify=TRUE, use.exprs=FALSE)

Arguments

x
flowSet to be used
FUN
the function to be applied to each element of x
simplify
logical (default: TRUE); if all true and all objects are flowFrame objects, a flowSet object will be constructed. If all of the values are of the same type there will be an attempt to construct a vector or matrix of the appropriate type (e.g. all numeric results will return a matrix).
use.exprs
logical (default: FALSE); should the FUN be applied on the flowFrame object or the expression values.
...
optional arguments to FUN.

See Also

apply, sapply

Examples

Run this code
fcs.loc <- system.file("extdata",package="flowCore")
file.location <- paste(fcs.loc, dir(fcs.loc), sep="/")
samp <- read.flowSet(file.location[1:3]) 

#Get summary information about each sample.
fsApply(samp,summary)

#Obtain the median of each parameter in each frame.
fsApply(samp,each_col,median)

Run the code above in your browser using DataLab