library(fpp2)
library(ggplot2)
gold, woolyrnq and gas represent.gold - Daily morning gold prices in US dollars. 1 January 1985 – 31 March 1989.
woolyrnq - Quarterly production of woollen yarn in Australia: tonnes. Mar 1965 – Sep 1994.
gas - Australian monthly gas production: 1956–1995.
help("gold")
ggtsdisplay("gold")
help("woolyrnq")
ggtsdisplay("woolyrnq")
help("gas")
ggtsdisplay("gas")Using autoplot() to plot each of these in separate plots.
autoplot(gold)
autoplot(woolyrnq)
autoplot(gas)
Finding the frequency of each series by applying the frequency() function.
frequency(gold)
## [1] 1
frequency(woolyrnq)
## [1] 4
frequency(gas)
## [1] 12Using which.max() to spot the outlier in the gold series and showing which observation it was.
which.max(gold)
## [1] 770
gold[which.max(gold)]
## [1] 593.7