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

broom::tidy(car::Anova(...)) returns mismatched columns #51

Merged
merged 3 commits into from Jul 3, 2015

Conversation

Projects
None yet
2 participants
@zeehio
Copy link
Contributor

zeehio commented May 26, 2015

Currently broom::tidy applied to an anova object as returned by the car::Anova function will give a wrong data frame with an unclear warning message:

Warning message:
In colnames(ret)[-1] <- newnames :
  number of items to replace is not a multiple of replacement length

The returned column names will be mismatched, as car::Anova returns columns in a different order than stats::anova and does not return the "Mean Sq" column.

This commit adds a check for the column names before tidying the anova object, preventing and fixing those column mismatches.

It is a pity that both packages are not compatible and use the same object name "anova", but I feel this is the best approach to tidy both of them.

Comments and suggestions are welcome.

Thanks for your time and work with this package

zeehio added some commits May 26, 2015

Improve compatibility tidying the car Anova
Currently broom::tidy() applied to an anova object as returned by the car package will give a wrong data frame with a poor warning message:
Warning message:
In colnames(ret)[-1] <- newnames :
  number of items to replace is not a multiple of replacement length

Moreover, the column names will be mismatched, as car::Anova returns columns in a different order than stats::anova.

This commit checks for the column names before tidying the object preventing column mismatches.

It is a pity that both packages are not compatible and use the same object name "anova".

dgrtwo pushed a commit that referenced this pull request Jul 3, 2015

David Robinson
Merge pull request #51 from zeehio/master
broom::tidy(car::Anova(...)) returns mismatched columns

@dgrtwo dgrtwo merged commit ec5c0bd into tidymodels:master Jul 3, 2015

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