valmetrics (version 1.0.0)

r2: r2

Description

Calculates the Coefficient of determination (R2) from observed and predicted values.

Usage

r2(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Value

Coefficient of determination (R2)

Details

Interpretation: larger is better.

Examples

Run this code
# NOT RUN {
obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
r2(o=obs, p=pred)

# }

Run the code above in your browser using DataLab