breaks_ppm | R Documentation |
breaks_ppm
creates a sequence of numbers with increasing differences
between them. Parameter ppm
defines the amount by which the difference
between values increases. The value for an element i+1
is calculated by
adding size
to the value of element i
and in addition also the
ppm(a, ppm)
, where a
is the value of the element i
plus size
. This
iterative calculation is stopped once the value of an element is larger
than to
. The last value in the result vector will thus not be equal to
to
(which is in contrast to the base seq()
function) but slightly
higher.
A typical use case of this function would be to calculate breaks for the binning of m/z values of mass spectra. This function allows to create m/z-relative bin sizes which better represents measurement errors observed on certain mass spectrometry instruments.
breaks_ppm(from = 1, to = 1, by = 1, ppm = 0)
from |
|
to |
|
by |
|
ppm |
|
numeric
with the sequence of values with increasing differences.
The returned values include from
and to
.
Johannes Rainer
res <- breaks_ppm(20, 50, by = 1, ppm = 50)
res
## difference between the values increases (by ppm)
diff(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.