crop_measurement {forceR}R Documentation

Crop Time Series

Description

Interactive function to crop a time series.

Usage

crop_measurement(file, path.data = NULL)

Arguments

file

File path to measurement.

path.data

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

Details

Select points at start and end of desired part of measurements. Only the last two points will be taken into account to allow the user to correct erroneous clicks.

If a measurement contains two distinct regions of bites with a lot of unnecessary data and/or measurement artefacts in-between (such as user-made peaks), I recommend to manually copy the RAW data files, give the copy a new measurement number (as if it was actually a separate measurement), and crop the distinct parts containing actual bites separately from the two copies of the file. For more distinct regions, create more copies.

I recommend to not crop the files too much in case baseline corrections are needed later, because then the baseline_corr() function will not be able to figure out where the actual baseline might be. Leaving several seconds before and after the first and last bite of a series will prevent such problems.

Value

Returns and, if ⁠path.data is not NULL⁠, saves data in csv-format in path.data.

The tibble has the following format:

t y
t.1 y.1
... ...
t.n y.n

Examples

# get file path of forceR example file
filename <- forceR_example(type = "raw")

# # crop file without storing result as file - out-commented to pass package tests
# file.cropped <- crop_measurement(file = filename,
#                    path.data = NULL)

# file.cropped


[Package forceR version 1.0.20 Index]