aggregate-methods {Cardinal} | R Documentation |
These methods calculate summary statistics over subsets of an imaging experiment.
## S4 method for signature 'SparseImagingExperiment' aggregate(x, by = c("feature", "pixel"), FUN, groups = NULL, tform = identity, as = "ImagingExperiment", BPPARAM = getCardinalBPPARAM(), ...) summarizeFeatures(x, FUN = "mean", ...) summarizePixels(x, FUN = "mean", ...)
x |
An imaging dataset. |
by |
Should the summarization be performed over pixels or features? |
FUN |
A function or list of functions that return statistical summaries. Known statistics can be provided to be computed more efficiently than providing the equivalent function. Known statistics include "min", "max", "mean", "sum", "sd", and "var". |
groups |
A grouping variable for summarization. The summary functions will be applied within each group. |
tform |
A unary transformation that should each row or column be transformed before summarization is applied. |
as |
What class of object should be returned ( |
BPPARAM |
An optional |
... |
Additional arguments to be passed to |
An ImagingExperiment
subclass if as=="ImagingExperiment"
or a DataFrame
subclass otherwise.
Kylie A. Bemis
set.seed(1) mse <- simulateImage(preset=1, npeaks=10, dim=c(10,10)) # calculate median spectrum aggregate(mse, by="feature", FUN=median, as="DataFrame") # summarize mean spectrum summarizeFeatures(mse, FUN="mean", as="DataFrame") # summarize image by TIC summarizePixels(mse, FUN=c(tic="sum"), as="DataFrame") # summarize mean spectrum grouped by pixels in/out of circle summarizeFeatures(mse, FUN="mean", groups=mse$circle, as="DataFrame")