peakr
contains gadgets for common operations on data obtained in natural sciences (e.g. spectra and time series). The aim is to ease common operations that would otherwise need a lot of iterative refinements in an analysis script.
Hopefully peakr
can also be used to make the transition into R easier and more attractive for beginners.
All functions try to encourage reproducibility by returning suggested code to produce the same result as in the gadget.
peak_<function>(df, x, y, ...)
)All gadgets follows a common naming scheme peak_<function>(df, x, y, ...)
. df
is a dataframe with a dataset, x
and y
specify columns in the dataset and ...
can be a range of function specific parameters to fine-tune behaviour.
The following gadgets are available:
peak_pick()
: Peak picking in dataset, guided by a simple algorithm to help get the highest points on a specific peak. Other packages contain algorithms to find peaks in data, but often require a lot of fine-tuning to only find real peaks. This gadget is suitable for e.g. the student who has to report a few spectra in a report or lab journal.peak_integrate()
: Peak integrationpeak_subtract()
: Baseline subtractionpeak_normalise()
: Normalisation (i.e. with respect to peak intensity)peak_smooth()
: Smoothingadd_<function>(df, ...)
, plot_<function>(df, x, y)
)When doing interactive analysis in a gadget, the result should still be completely reproducible so that the same result is obtained the next time the script is run. For this reason all peak_*()
functions return a line of R code with a corresponding add_*()
function, that will produce the same result as the interactive analysis. This code is automatically copied to the clipboard, ready to be pasted into the analysis script.
The plot from the gadget can be reproduced with the corresponding plot_*()
function.
peakr
is not on CRAN yet. Install using devtools
.
devtools::install_github('emiltb/peakr')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.