Skip to content

Commit

Permalink
Removed unit test of autoplot.seas()
Browse files Browse the repository at this point in the history
Reason: Travis can't install seasonal package.
  • Loading branch information
robjhyndman committed Feb 1, 2017
1 parent 90bd2e9 commit d901474
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/testthat/test-ggplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if(require(testthat))
test_that("tests for autoplot/gg functions", {
library(ggplot2)
lungDeaths <- cbind(mdeaths, fdeaths)

ggAcf(wineind)
autoplot(Acf(wineind))
identical(ggAcf(wineind, plot=FALSE)$acf, acf(wineind, plot=FALSE, lag.max = 24)$acf)
Expand All @@ -16,15 +16,15 @@ if(require(testthat))
ggCcf(mdeaths, fdeaths)
autoplot(Ccf(mdeaths, fdeaths))
identical(ggCcf(mdeaths, fdeaths, plot=FALSE)$acf, ccf(mdeaths, fdeaths, plot=FALSE, type="correlation", lag.max = 24)$acf)

arimafit <- Arima(USAccDeaths, order = c(1,1,1), seasonal = c(1,1,1))
autoplot(arimafit)
autoplot(arimafit, type = "ma")
autoplot(arimafit, type = "ar")

arfit <- ar(USAccDeaths)
autoplot(arfit)

decomposefit <- decompose(USAccDeaths)
autoplot(decomposefit)
etsfit <- ets(USAccDeaths, model="ANA")
Expand All @@ -33,52 +33,52 @@ if(require(testthat))
autoplot(structfit)
stlfit <- stl(USAccDeaths, s.window = "periodic")
autoplot(stlfit)
seasfit <- seasonal::seas(USAccDeaths)
autoplot(seasfit)

#seasfit <- seasonal::seas(USAccDeaths)
#autoplot(seasfit)

etsfcast <- forecast(etsfit)
autoplot(etsfcast)
autoplot(etsfcast, PI = FALSE)

lmfit <- lm(mpg ~ disp, data=mtcars)
lmfcast <- forecast(lmfit, newdata=data.frame(disp=214))
autoplot(lmfcast)

mfcast <- forecast(lungDeaths)
autoplot(mfcast)

ggtsdisplay(USAccDeaths, plot.type = "spectrum")
ggtsdisplay(USAccDeaths, plot.type = "partial")
ggtsdisplay(USAccDeaths, plot.type = "histogram")
ggtsdisplay(USAccDeaths, plot.type = "scatter", theme=ggplot2::theme_bw())

gglagplot(woolyrnq, lags=2)
gglagplot(lungDeaths, lags=2)
gglagplot(WWWusage, do.lines = FALSE, colour = FALSE, labels = TRUE)

gglagchull(woolyrnq, lags=4)

ggmonthplot(woolyrnq)

ggseasonplot(woolyrnq, year.labels = TRUE, year.labels.left = TRUE)
ggseasonplot(USAccDeaths, polar=TRUE, col=1:5, continuous = TRUE)

splinefit <- splinef(airmiles, h=5)
autoplot(splinefit)

autoplot(USAccDeaths)
autoplot(lungDeaths)
autoplot(lungDeaths, facet=TRUE)

autoplot(USAccDeaths) + geom_forecast()
autoplot(USAccDeaths) + geom_forecast(etsfcast, series="ETS")
autoplot(lungDeaths) + geom_forecast()
autoplot(lungDeaths) + geom_forecast(mfcast, series = c("mdeaths", "fdeaths"))
autoplot(lungDeaths) + geom_forecast(mfcast)
autoplot(lungDeaths) + geom_forecast(mfcast, series = TRUE)
autoplot(lungDeaths, facet=TRUE) + geom_forecast()

gghistogram(USAccDeaths, add.kde = TRUE)
})
}

0 comments on commit d901474

Please sign in to comment.