Description Usage Arguments Value Author(s) See Also Examples
Aggregate values in x
for bins defined on y
: all values
in x
for values in y
falling into a bin (defined on y
) are
aggregated with the provided function FUN
.
1 2 3 4 5 6 7 |
x |
|
y |
|
size |
|
breaks |
|
FUN |
|
list
with elements x
(aggregated values of x
) and mids
(the
bin mid points).
Johannes Rainer, Sebastian Gibb
Other grouping/matching functions:
closest()
1 2 3 4 5 6 7 8 9 | ## Define example intensities and m/z values
ints <- abs(rnorm(20, mean = 40))
mz <- seq(1:length(ints)) + rnorm(length(ints), sd = 0.001)
## Bin intensities by m/z bins with a bin size of 2
bin(ints, mz, size = 2)
## Repeat but summing up intensities instead of taking the max
bin(ints, mz, size = 2, FUN = sum)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.