Learn R Programming

collinear (version 1.1.1)

f_rsquared: R-squared between a response and a predictor

Description

Computes the R-squared between a response and a predictor. Fastest option to compute preference order.

Usage

f_rsquared(x, y, df)

Value

R-squared

Arguments

x

(required, character string) name of the predictor variable.

y

(required, character string) name of the response variable

df

(required, data frame) data frame with the columns 'x' and 'y'.

Examples

Run this code

data(vi)

#subset to limit example run time
vi <- vi[1:1000, ]

f_rsquared(
  x = "growing_season_length", #predictor
  y = "vi_mean",               #response
  df = vi
)

Run the code above in your browser using DataLab