plot_peaks {forceR} | R Documentation |
Plot Peaks
Description
Plots the peaks identified by the function find_peaks()
.
Usage
plot_peaks(
df.peaks,
df.data,
additional.msecs = 2000,
plot.to.screen = TRUE,
path.plots = NULL,
show.progress = FALSE
)
Arguments
df.peaks |
df.peaks The resulting tibble of the function |
df.data |
A data frame or tibble in the below format. The columns |
additional.msecs |
A numeric value indicating how many m.secs before and after the actual peak curve should be plotted. Default: |
plot.to.screen |
A logical value indicating if results should be
plotted in the current R plot device. Default: |
path.plots |
A string character defining where to save the plots. If |
show.progress |
A logical value indicating if progress should be
printed to the console. Default: |
Details
df.peaks
at least needs to contain the following columns:
measurements
| starts
| ends
|
| :—-: | :—-: |:—-: |:—-: |
| measurements.1
| starts.1
| ends.1
|
| ...
| ...
| ...
|
| measurements.n
| starts.m
| ends.m
|
Check forceR::peaks.df
to see an example tibble.
df.data
at least needs to contain the following columns:
t | force | measurement |
t.1 | force.1 | measurement.1 |
... | ... | ... |
t.n | force.n | measurement.m |
Check forceR::df.all.200.tax
to see an example tibble.
Value
Plots one graph per peak curve and, if plot.to.pdf == TURE
, saves all peak curves as one PDF at path.plots
.
Examples
# Using the first row of forceR::peaks.df and the forceR::df.all.200.tax dataset:
# plot peaks
plot_peaks(df.peaks = forceR::peaks.df[1, ],
df.data = forceR::df.all.200.tax,
additional.msecs = 20) # instead of the default (2000) because of
# the highly downsampled example dataset.