View source: R/utility_functions.R
slope_auto | R Documentation |
Uses the Bluehill Automatic Slope algorithm
1. divide the series into six segments
2. calculate the slope for each segment
3. sum adjacent pairs of slope (1 + 2, 2 + 3 ... 5 + 6)
4. find the pair with the maximum sum
5. return the maximum slope in that pair
This version uses lm_simple
to return other useful statistics
slope_auto(DT, formula)
DT |
a |
formula |
a standard R formula specifying which columns to use |
A named list(int, slope, p, rsq)
for the segment with maximum slope
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.