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 labels to prcomp object before tidying #265
Conversation
If you pull in the most recent master the (AppVeyor) build should pass. It'd be nice to add a regression test and then I'd be happy to merge. |
Conflicts: R/prcomp_tidiers.R
Thanks! I'm having some issues with the build (on a testing branch), but i'll push the merge and see what happens. |
Looks good. Would you add a quick test to make sure that the reprex from before: library(broom)
test <- as.data.frame(matrix(1:9, ncol = 3) + rnorm(n = 9, sd = 0.25))
test
#> V1 V2 V3
#> 1 0.7707063 3.870905 7.091106
#> 2 2.3385348 4.987070 7.835155
#> 3 2.6638938 6.006691 8.690749
pca <- prcomp(test)
tidy(pca, matrix = "u")
#> Error in data.frame(label = rep(labels, times = ncomp), samples): arguments imply differing number of rows: 0, 9
test2 doesn't give an error? |
It works for me! |
Or, did you mean add a test to some part of the PR? |
Yeah I meant add a test to the PR so that if the implementation gets changed in the future the error doesn't return. |
The test current checks that the original reprex fails. We should instead make sure that it passes. I think you want |
The check uses |
Woops, my bad. That's it then. Feel free to add yourself as a contributor in DESCRIPTION! |
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. |
This would fix #254 (see the discussion there for examples).