Description Usage Arguments Value Examples
Transforms raw data into regression curves using the drm
function in the drc
package. The response data can be constrained between minima and maxima (for example, the default sets any negative predicted y value to 0).
1 2 |
data |
Data frame with function-valued species data along with a column named "species" |
x_variable |
The name of the column in |
y_variable |
The name of the column in |
fct |
Function type to pass to |
min_x |
Lower range to remove from raw x data |
max_x |
Upper range to remove from raw x data |
min_y |
Lower range to remove from predicted response (for example, for response data in which only positive values are allowed, the min_y can be set to 0 (the default)). |
max_y |
Upper range to remove from predicted response. |
eval_length |
How many points to evaluate along the range of x. |
... |
Optional further arguments to pass to the drm function. |
X |
X (formatted for phylocurve.generalized) |
Y |
Y (formatted for phylocurve.generalized) |
1 2 3 4 5 6 7 8 9 10 | x_length <- 50
nspecies <- 25
sim_data <- sim.curves(nspecies = nspecies,x_length = x_length)
# Fit nonlinear curves to raw data
curve_data <- nonlinear.fit(data = sim_data$data,x_variable = "x",y_variable = "y",min_y = 0)
# Align curve data using dynamic time warping
# NOT RUN (takes several minutes)
# P <- phylocurve.generalized(tree = sim_data$tree,X = curve_data$X,Y = curve_data$Y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.