Loading the packages

library(ggplot2)
library(dplyr)
library(lubridate)
library(stringr)

Loading the data

wines <- read.csv(file="AustralianWines.csv")

Excluding the missing data.

wines <- na.omit(wines)

Data partitioning

fortified <- ts(wines$Fortified, start=c(1980,1), end=c(1994,12), frequency = 12)

train.fortified <- fortified[1:178]
train.fortified <- ts(train.fortified, start=c(1980,1), frequency=12 )

test.fortified <- fortified[179:180]
test.fortified <- ts(test.fortified, start=c(1994,11), frequency=12 )


red <- ts(wines$Red, start=c(1980,1), end=c(1994,12), frequency = 12)

train.red <- red[1:178]
train.red <- ts(train.red, start=c(1980,1), frequency=12 )

test.red <- red[179:180]
test.red <- ts(test.red, start=c(1994,11), frequency=12 )


rose <- ts(wines$Rose, start=c(1980,1), end=c(1994,12), frequency = 12)

train.rose <- rose[1:178]
train.rose <- ts(train.rose, start=c(1980,1), frequency=12 )

test.rose <- rose[179:180]
test.rose <- ts(test.rose, start=c(1994,11), frequency=12 )


sparkling <- ts(wines$sparkling, start=c(1980,1), end=c(1994,12), frequency = 12)

train.sparkling <- sparkling[1:178]
train.sparkling <- ts(train.sparkling, start=c(1980,1), frequency=12 )

test.sparkling <- sparkling[179:180]
test.sparkling <- ts(test.sparkling, start=c(1994,11), frequency=12 )


sweet.white <- ts(wines$Sweet.white, start=c(1980,1), end=c(1994,12), frequency = 12)

train.sweet.white <- sweet.white[1:178]
train.sweet.white <- ts(train.sweet.white, start=c(1980,1), frequency=12 )

test.sweet.white <- sweet.white[179:180]
test.sweet.white <- ts(test.sweet.white, start=c(1994,11), frequency=12 )


dry.white <- ts(wines$Dry.white, start=c(1980,1), end=c(1994,12), frequency = 12)

train.dry.white <- dry.white[1:178]
train.dry.white <- ts(train.dry.white, start=c(1980,1), frequency=12 )

test.dry.white <- dry.white[179:180]
test.dry.white <- ts(test.dry.white, start=c(1994,11), frequency=12 )