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 find_peaks(). See ?find_peaks for more details.

df.data

A data frame or tibble in the below format. The columns t (time), force and measurement (measurement ID) must be present. This will usually be the same table that was used before in find_peaks().

additional.msecs

A numeric value indicating how many m.secs before and after the actual peak curve should be plotted. Default: 2000

plot.to.screen

A logical value indicating if results should be plotted in the current R plot device. Default: TRUE.

path.plots

A string character defining where to save the plots. If NULL, plots will not be saved to PDF files. Default: NULL

show.progress

A logical value indicating if progress should be printed to the console. Default: FALSE.

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.


[Package forceR version 1.0.20 Index]