New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tidiers for stats::decompose and stats::stl #165

Merged
merged 3 commits into from Nov 19, 2017

Conversation

Projects
None yet
2 participants
@atheriel
Contributor

atheriel commented Sep 30, 2016

This PR adds an augment s3 method for R's two built-in seasonal decompositions. It does not add tidy or glance support, since neither of these methods produce model output, per se.

The augment method struck me as a good for turning the output of these decompositions into something that can be added back to the data. So, for example (using the datasets::nottem time series):

# Perform seasonal decomposition on the data with both decompose and stl:
d1 <- stats::decompose(nottem)
d2 <- stats::stl(nottem, s.window = "periodic", robust = TRUE)

# Compare the original series to these two decompositions.
cbind(broom::tidy(nottem), broom::augment(d1), broom::augment(d2))

The Roxygen documentation contains the above example (demonstrating basic usage) and a much longer one for visualising both types of decomposition using ggplot2. I don't know what the policy is on including these larger examples, but I'm happy to amend this one to fit the style of the project.

Similarly, I don't know what the policy is on adding test for new tidiers, but again I'm happy to write them.

@atheriel atheriel force-pushed the atheriel:decompose-and-stl branch from 62dd7f3 to b7899a4 Jan 13, 2017

Add tidiers for stats::decompose and stats::stl.
This commit adds an `augment` s3 method for R's two built-in seasonal
decompositions. It does not add `tidy` or `glance` support, since
neither of these methods produce model output, per se.

The Roxygen documentation also contains a short example demonstrating
basic usage and a much longer one for visualising both types of
decomposition using ggplot2.

@atheriel atheriel force-pushed the atheriel:decompose-and-stl branch from b7899a4 to c8042fe Jan 14, 2017

dgrtwo added some commits Nov 19, 2017

@dgrtwo dgrtwo merged commit 3575691 into tidymodels:master Nov 19, 2017

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@dgrtwo

This comment has been minimized.

Collaborator

dgrtwo commented Nov 19, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment