View source: R/amp_melt_curve_functions.R
calculate_dydx | R Documentation |
Used in tidyqpcr to calculate dR/dT for a melt curve of fluorescence signal R vs temperature T.
calculate_dydx(x, y, method = "spline", ...)
x |
input variable, numeric vector, assumed to be temperature |
y |
output variable, numeric vector of same length as x, assumed to be fluorescence signal. |
method |
to use for smoothing: "spline" default, uses smoothing spline stats::smooth.spline. "diff" base::diff for lagged difference |
... |
other arguments to pass to smoothing method. |
estimated first derivative of y with respect to x, numeric vector of same length as y.
Other melt_curve_functions:
calculate_drdt_plate()
# create simple curve
x = 1:5
y = x^2
# calculate gradient of curve
#----- use case 1 : using splines
calculate_dydx(x, y)
# optional arguments are passed to smooth.splines function
calculate_dydx(x, y, spar = 0.5)
#----- use case 2 : using difference between adjacent points
calculate_dydx(x, y, method = "diff")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.