aggregate_fv {groupedHyperframe} | R Documentation |
Aggregate fv.objects by Cluster
Description
Aggregate information in fv.objects by sample clustering.
Usage
aggregate_fv(
X,
by = stop("must specify `by`"),
f_aggr_ = pmean,
mc.cores = getOption("mc.cores"),
...
)
Arguments
X |
a groupedHyperframe, containing one or more fv.object column(s) |
by |
one-sided formula, sample clustering.
Use only one-level hierarchy (e.g., |
f_aggr_ |
see function |
mc.cores |
integer scalar, see function mclapply. Default is 1L on Windows, or detectCores on Mac. |
... |
additional parameters, currently not in use |
Value
Function aggregate_fv()
returns a data.frame, with
aggregated information stored in matrix-columns.
Note that hyperframe does not support
matrix-column (for good reasons!).
Therefore, function aggregate_fv()
must return a data.frame,
instead of a hyperframe.
Examples
library(spatstat.data)
library(spatstat.geom)
flu$pattern[] = flu$pattern |>
lapply(FUN = `mark_name<-`, value = 'stain') # read ?flu carefully
r = seq.int(from = 0, to = 100, by = 5)
flu |>
subset(stain == 'M2-M1') |>
as.groupedHyperframe(group = ~ virustype/frameid) |>
Gcross_(i = 'M1', j = 'M2', r = r, correction = 'best') |>
aggregate_fv(by = ~ virustype)
[Package groupedHyperframe version 0.2.4 Index]