## Parsed with column specification:
## cols(
## YearMonth = col_double(),
## Value = col_double()
## )
##
## Attaching package: 'lubridate'
## The following object is masked from 'package:base':
##
## date
## [1] "numeric"
## [1] "Date"
#month name not number
monthly_temps <- mutate(monthly_temps,
year=year(date),
month=month(date,label=TRUE))
#rename variables
monthly_temps <- rename(monthly_temps, temperature_anomaly = Value)
monthly_temps <- select(monthly_temps, -YearMonth)
#variables
monthly_temps$month <- factor(monthly_temps$month)
monthly_temps$year <- factor(monthly_temps$year)
monthly_temps$temperature_anomaly <- as.numeric(monthly_temps$temperature_anomaly)
#line graph
ggplot()+ geom_line(data=monthly_temps, aes(x=month, y= temperature_anomaly, group=year, color=temperature_anomaly))+
scale_color_gradientn(colors=rev(rainbow(2)))+theme_minimal()+
labs(title="Historical Temperature Anomalies since 1880 by month",y= "Temperature anomalies in degrees celsius")