bestFitLine | R Documentation |
This function returns for the range of x values the line of best fit and corresponding R-squared measure. Calculation is performed by the (currently undocumented) 'predictdf()' generic and its methods. 'stats::lm' is used to build the regression model w formula 'y~x'.
bestFitLine(dt, collapse = TRUE)
dt |
data.frame with at least two columns: x) representing the independent variable and y) representing the dependent variable |
data.table with the follwing columns x, y (best fit line) and r2 (R-squared)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.