fsApply: Apply a Function over values in a flowSet

fsApplyR Documentation

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 then 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

...

optional arguments to FUN.

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.

Author(s)

B. Ellis

See Also

apply, sapply

Examples


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)



RGLab/flowCore documentation built on Aug. 26, 2024, 8:52 a.m.