28.6 1749-2013 年太阳黑子数据

再从官网拿到最近的数据

plot(sunspot.month, xlab = "Year", ylab = "Monthly sunspot numbers",
     main = "Monthly mean relative sunspot numbers from 1749 to 2013")

autoplot(sunspot.month,
  main = "Monthly mean relative sunspot numbers from 1749 to 2013",
  xlab = "Year", ylab = "Monthly sunspot numbers"
)
时序图:太阳黑子月均数量时序图:太阳黑子月均数量

图 28.2: 时序图:太阳黑子月均数量

autoplot(sunspots)

autoplot(sunspot.year, xlab = "Year", ylab = "Yearly Sunspot Data, 1700-1988") +
  theme_minimal()
太阳黑子数量年平均时序图

图 28.3: 太阳黑子数量年平均时序图

library(dygraphs)
dygraph(sunspot.month)
hw <- HoltWinters(sunspot.month)
predicted <- predict(hw, n.ahead = 72, prediction.interval = TRUE)

dygraph(predicted, main = "Predicted sunspot numbers") %>%
  dyAxis("x", drawGrid = FALSE) %>%
  dySeries(c("lwr", "fit", "upr"), label = "sunspot") %>%
  dyOptions(colors = hcl.colors(3))
library(highcharter)
highchart() %>% 
  hc_xAxis(type = "datetime") %>% 
  hc_add_series(data = sunspot.month, name = "1749 至今") %>% 
  hc_add_series(data = sunspots, name = "1749-1983") %>% 
  hc_title(text = "月均太阳黑子数")