Skip to content
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
Merged

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

merged 3 commits into from Nov 19, 2017

Conversation

atheriel
Copy link
Contributor

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 and others added 3 commits January 14, 2017 12:56
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.
@dgrtwo dgrtwo merged commit 3575691 into tidymodels:master Nov 19, 2017
@dgrtwo
Copy link
Collaborator

dgrtwo commented Nov 19, 2017

Thanks!

@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2021
@atheriel atheriel deleted the decompose-and-stl branch March 13, 2021 02:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants