correct_peak {forceR}R Documentation

Manually Correct Single Peak

Description

Interactive correction of a single peak.

Usage

correct_peak(
  df.peaks,
  df.data,
  measurement,
  peak,
  additional.msecs = 500,
  path.data = NULL
)

Arguments

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, measurement, and specimen. (measurement ID) must be present. This will usually be the same table that was used before in find_peaks().

measurement

A character string defining the measurement ID (e.g. measurement number) of the peak to be corrected. Must be congruent with the respective measurement ID within df.peaks and df.

peak

A numerical value defining the peak to be corrected.

additional.msecs

A numerical value defining the time before and after the originally defined window of the peak to be corrected. Higher values allow defining start and end points further away from the original start and end points. Default: 500. @param path.data A string character defining where to save the result and log file. If NULL (default), data is not stored in files. Log files cannot be retrieved in this case.

path.data

A string character defining where to save the results. If NULL (default), data is not stored in a file.

Details

When running the function, you will be prompted to select the actual start and end of the current peak of the current measurement. If more or less than exactly 2 points are defined, the process is terminated.

Value

Changes values within df.peaks and returns the changed tibble.

df.data needs to contain the following columns:

t force measurement
t.1 force.1 measurement.1
... ... ...
t.n force.n measurement.m

Examples

# Using the forceR::df.all.200.tax dataset:

# This function needs user input.
peaks.df <- correct_peak(df.peaks = forceR::peaks.df,
                        df.data = forceR::df.all.200.tax,
                        measurement = "m_01",
                        peak = 1,
                        additional.msecs = 5)


[Package forceR version 1.0.20 Index]