This generic function calculates the squared multiple correlation, or 'proportion variance explained', according to the formula
R^2 = 1  SS(obj)/SS(tot)
, where SS(obj) = sum (y  pred(y))^2 is the squared error of predictions pred(y), and SS(tot) = sum (y  mean(y))^2 the total sum of squares.
1 
object 
An object of a suitable class for the RSquared to be
calculated  an object with a predict method, and if y is missing, a slot

... 
Some methods for this generic function accept an argument y, providing the observed data. At present, no other additional arguments are used 
Returns a numeric value with the corresponding RSquared.
Maarten Speekenbrink
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.