I have two questions. I am using a dataset detailing information on Chicago (temp, ozone, season, date). I would like a plot show the temperature across time, along with a smooth line to show the trend, specifically with dates isolated from 1997-2000.
Thus:
library(ggplot2)
library(dplyr)
chicago <- read.csv(file = 'FilePath')
## Limit data to 1997-2000
chicago2 <- chicago %>%
filter(date >= "1997-01-01" & date <= "2000-12-31")
ggplot(chicago2, aes(x=date, y=temp)) +
geom_point() +
geom_smooth() +
labs(title="Temperature")
My issues are as follows:
There seems to be an issue with the x-axis, with the dates not cleanly represented. When I zoom into the picture, it seems like R is plotting every single date on the x-axis, but I am not sure if this is the actual issue. Scatterplot
While I am able to accurately plot a scatterplot, there is no overlayed smooth line, despite the use of the geom_smooth() function.
Looking forward to your responses,