sink_fit: Run segmented regressions on cell sinking data

Description Usage Arguments Value Note Examples

View source: R/sink fit.R

Description

Fits a segmented regression to cell sinking data (square root RFU values) by well. The model parameters can then be used to calculate sinking rate.

Usage

1
2
sink_fit(database_rfu, breakpoints = c(20, 50), attempts = 19, export_output = FALSE,
save_as = "Sinking_Fits.csv")

Arguments

database_rfu

dataframe containing the columns "Plate", "Well", "Elapsed.Time.m", and "RFU". Can be generated by the user, or by running the import functions on raw data files.

breakpoints

initial x-axis estimates where the regression should be broken up.

attempts

number of times the segmented regression should be run until a fit is generated. Do not change unless needed.

export_output

whether the resulting dataframe should be exported to .csv.

save_as

desired filename, if results are to be exported.

Value

A dataframe containing the model parameters, with each row representing a single well. The output parameters include well bottom (mean of 3 lowest points after second breakpoint), slopes 1, 2, and 3, breakpoints 1 and 2, y-intercepts on each of the slopes, and 95

Note

The parameters generated by this function are NOT final sinking rates. You may use the sink_rate() function to generate sinking rate estimates from the parameters, or you may wish to apply your own equation.

Examples

1
2
3
4
5
sink_parameters <- sink_fit(sinking_data)

sink_param <- sink_fit(sinking_data, breakpoints = c(10, 30))

sink_fit(sinking_data, breakpoints = c(2, 10), export_output = T, save_as = "Sink_Parameters.csv")

mlrioux/sinkworx documentation built on June 2, 2020, 10:28 p.m.