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

use ldply instead of lapply to tidy aovlist's #377

Merged
merged 8 commits into from Jun 21, 2018

Conversation

Projects
None yet
2 participants
@mvevans89
Contributor

mvevans89 commented Jun 15, 2018

this changes the way tidy is used to tidy aovlist's (such as within-subject error structures) to close issue #299

@alexpghayes

Thanks so much for this PR! I made a couple comments on the code, but this looks great overall.

function(a) dplyr::mutate(ret[[a]], stratum = a)
)
ret <- do.call("rbind", ret)
ret <- plyr::ldply(x, tidy, .id = "stratum")

This comment has been minimized.

@alexpghayes

alexpghayes Jun 15, 2018

Collaborator

We're looking to move away from plyr at the moment. Would you be willing to use purrr here instead?

This comment has been minimized.

@mvevans89

mvevans89 Jun 15, 2018

Contributor

Works for me. I'll switch it up.

#'
#' @importFrom plyr ldply
#'
#' @import dplyr

This comment has been minimized.

@alexpghayes

alexpghayes Jun 15, 2018

Collaborator

dplyr and plyr get imported package-wide in DESCRIPTION, so I believe these aren't necessary.

This comment has been minimized.

@mvevans89

mvevans89 Jun 15, 2018

Contributor

Got it. I'll remove them.

@@ -0,0 +1,15 @@
context("anova tidiers")

This comment has been minimized.

@alexpghayes

alexpghayes Jun 15, 2018

Collaborator

Regression tests! Awesome!

test_that("tidy.aovlist works"){
aovlistfit <- aov(mpg ~ wt + disp + Error(drat), mtcars)
td <- suppressWarnings(tidy(aovlistfit))

This comment has been minimized.

@alexpghayes

alexpghayes Jun 15, 2018

Collaborator

What kind of warnings are getting suppressed here?

This comment has been minimized.

@mvevans89

mvevans89 Jun 15, 2018

Contributor

I checked and there actually are none. Warning suppression was just a hold over from copying the format of the test-lm.R. I'll take it out

@alexpghayes

This comment has been minimized.

Collaborator

alexpghayes commented Jun 15, 2018

Don't worry about the build failure at the moment, BTW, that's my fault and I need to fix it.

@alexpghayes

This comment has been minimized.

Collaborator

alexpghayes commented Jun 15, 2018

Changes look good. Will merge as soon as I sort out the lavaan stuff causing the build failure.

@mvevans89 mvevans89 requested a review from dgrtwo as a code owner Jun 18, 2018

alexpghayes added some commits Jun 18, 2018

@alexpghayes

This comment has been minimized.

Collaborator

alexpghayes commented Jun 18, 2018

Okay, think we're good to merge. Feel free to add yourself as a contributor to DESCRIPTION if you'd like!

@alexpghayes alexpghayes merged commit 24fc3c5 into tidymodels:master Jun 21, 2018

4 checks passed

codecov/patch 100% of diff hit (target 84.13%)
Details
codecov/project Absolute coverage decreased by -0.02% but relative coverage increased by +15.86% compared to 03b182d
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment