bestFitLine: Best Fit Line from Linear Regression

View source: R/utils-stats.R

bestFitLineR Documentation

Best Fit Line from Linear Regression

Description

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'.

Usage

bestFitLine(dt, collapse = TRUE)

Arguments

dt

data.frame with at least two columns: x) representing the independent variable and y) representing the dependent variable

Value

data.table with the follwing columns x, y (best fit line) and r2 (R-squared)


VEuPathDB/plot.data documentation built on Feb. 20, 2025, 6:33 p.m.