Invalid model formula in extractvars when trying to display scatter matrix

181 Views Asked by At

When trying to create a scatter matrix in R, I am using the pairs function inputting columns 1, 6, 11, and 14 as so:

pairs(~ 1 + 6 + 11 + 14, data = housing.df)

but getting an invalid model formula error:

pairs(~ 1 + 6 + 11 + 14, data = housing.df) Error in terms.formula(formula, data = data) : invalid model formula in ExtractVars

What does it mean, and how can it be resolved?

1

There are 1 best solutions below

0
On

pairs(~ V1 + V6 + V11 + V14, data = housing.df)