I am trying to create time series line plots for two variables of an xlsx file that I imported into R. The code I used is listed below.
x <- myData$Google.Close
y <- myData$Amazon.Close
plot(Google.Close, Amazon.Close, type="1", main = "GoogleAmazonStock", xlab="Google.Close", ylab="Amazon.Close")
Error in plot(Google.Close, Amazon.Close, type = "1", main = "GoogleAmazonStock", :
object 'Google.Close' not found
I keep getting this error message when I try to run the code. The column headings of the xlsx dataset are "Google.Close" and "Amazon.Close"
Thanks for your reply. I tried your suggestion and I got this error message.
x <- myData$Google.Close
y <- myData$Amazon.Close
plot(x, y, type="1", main = "GoogleAmazonStock", xlab="Google.Close", ylab="Amazon.Close")
Error in plot.xy(xy, type, ...) : invalid plot type '1'