Error in eval(expr, envir, enclos) : object ' ' not found

r
plot

#1

I am currently working on data of airquality in R and I want to plot the graph between Ozone and Solar.R but I am getting the error “Error in eval(expr, envir, enclos) : object ‘Ozone’ not found” and I have also attached the code .

data(airquality)
names(airquality)
plot(Ozone~Solar.R)


#2

In R, column names don’t mean anything without the proper reference to the data set you are using. So, try either

with(airquality, plot(Ozone~Solar.R))

or

plot(airquality$Ozone~airquality$Solar.R)