I keep getting the same error when I enter this code:
ggplot(exchangeGBP) + aes(Date, GBP/EUR) + geom_line(color = "deepskyblue")
the error code: Error in FUN(X[[i]], ...) : object 'Date' not found
should I install a package or change the code?
The +
before aes
seems to be the issue
library(ggplot2)
ggplot(exchangeGBP, aes(Date, `GBP/EUR`)) +
geom_line(color = 'deepskyblue') +
theme_bw()
set.seed(24)
exchangeGBP <- tibble(Date = seq(Sys.Date() - 10,
length.out = 10, by = '1 day'), `GBP/EUR` = rnorm(10))