Learning Programming in R – Next
global_temp <- read.csv(“datasets/global_temperature.csv”)
plot(global_temp$year, global_temp$degrees_celsius,
type = “l”, col = “forestgreen”,
xlab = “year”, ylab = “degrees celsius”)
======================================
The autoplot function from ggplot2
library(forecast)
library(ggplot2)
# Converting global_temp into a time series (ts) object.
global_temp_ts <- ts(global_temp$degrees_celsius,
start = global_temp$year[1])
# Forecasting global temperature 50 years into the future
# using an exponential smoothing state space model (ets).
temperature_forecast <- forecast( ets(global_temp_ts), h = 50)
# Plotting the forecast
autoplot(temperature_forecast)
======================================
Thank you for the good writeup. It in fact was a amusement account it.
Look advanced to more added agreeable from you! However, how
could we communicate?
It is just self note, you can reference it if needed. Thanks.