addr2 | R Documentation |
addr2
produces an r-squared (r2) expression (r2 = ...) given a vector of observation and prediction.
addr2(obs, pred, decimal = 2)
obs |
vector of observation. |
pred |
vector of prediction. |
decimal |
displayed decimal places. |
An r2 expression for the given vectors of observation and prediction.
fit = lm(dist ~ speed, data = cars) plot(cars) abline(fit, col = 'red') title(addlmeq(fit, 2), adj = 0.1, line = -1.8, col.main = 'blue', cex.main = 1.1) title(addr2(cars$dist, predict(fit)), adj = 0.08, line = -2.8, col.main = 'blue', cex.main = 1.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.