[Solved] Object not detected in R [closed]


There are two ways:

1) Attaching the data:

attach(data1)

And then this code should work:

cor(V1, V2)

2) Using $ for accesing columns in a dataframe

cor(data1$V1, data1$V2)

solved Object not detected in R [closed]