compute_growth_rates: Function to compute growth rates

View source: R/compute_growth_rates.R

compute_growth_ratesR Documentation

Function to compute growth rates

Description

This function takes a dataframe with the raw data and the information from the layout file and calculate growth rate (mu) using Savitzky and Golay filter(savgol). Here the first derivative is given in the parameter m. And polynomial degree p = 1

Usage

compute_growth_rates(df_data, var_gr, ws, plate_file = NULL)

Arguments

df_data

Is a dataframe that combines data files with layout files

var_gr

This the attribute to be used to calculate growth rates

ws

is the windowsize in hours

plate_file

the name of the plate to be use to calculate the growth rates.

Value

Returns the input dataframe with the column containing the growth rates.

Warning

Note that the time should be a time series, if the time series is broken the growth rates are not calculated and the process stops.

Examples

file_path <- system.file("extdata", "test_gr_spectramax.txt",
  package = "mpxtractor"
)

# Data is store as a tibble
df_data <- read_spectramax_data(file = file_path)

df_gr_data <- mpxtractor::compute_growth_rates(
  df_data = df_data,
  var_gr = "Measurement",
  ws = "2hs"
)
# Main function

MartinBanchero/mpxtractor documentation built on March 30, 2022, 10:56 p.m.