r2 | R Documentation |
Computes the R-Squared.
r2(x, y = x, remove_na = TRUE)
x |
( |
y |
( |
remove_na |
( |
Pearson's correlation coefficient is computed as:
where Cor is the Pearson's correlation coefficient of the two variables.
A single numeric value with the R-Squared value.
Other numeric_metrics:
maape()
,
mae()
,
mse()
,
nrmse()
,
numeric_summary()
,
pearson()
,
rmse()
,
spearman()
## Not run:
set.seed(1)
x <- rnorm(100)
r2(x, x)
r2(x, x + rnorm(100, 2))
r2(x, x - 1)
r2(x, x + 10)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.