R2 function

R2 coefficient