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

retain data in lda_ord output #65

Closed
corybrunson opened this issue Dec 9, 2024 · 0 comments
Closed

retain data in lda_ord output #65

corybrunson opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@corybrunson
Copy link
Owner

lda_ord() inherits the ret.x parameter from MASS::lda() to retain the input data in the model output. It likewise induces a bug in the recover_aug_rows() method, as shown below. This should be resolved in the customized function.

library(ordr)
#> Loading required package: ggplot2

# using `MASS::lda()`

iris_lda <- 
  ordinate(iris, cols = 1:4, MASS::lda, grouping = iris$Species)
#> Warning in recover_aug_rows.lda(x): Could not locate data used to fit 'x'.

iris_lda <- 
  ordinate(iris, cols = 1:4, MASS::lda, ret.x = TRUE, grouping = iris$Species)
#> Warning in recover_aug_rows.lda(x): Could not locate data used to fit 'x'.
#> Error in `dplyr::bind_rows()`:
#> ! Can't combine `..1$grouping` <character> and `..2$grouping` <logical>.

# using `ordr::lda_ord()`

iris_lda <- 
  ordinate(iris, cols = 1:4, lda_ord, grouping = iris$Species)
#> Warning in recover_aug_rows.lda_ord(x): Could not locate data used to fit 'x'.

iris_lda <- 
  ordinate(iris, cols = 1:4, lda_ord, ret.x = TRUE, grouping = iris$Species)
#> Error in `dplyr::bind_rows()`:
#> ! Can't combine `..1$grouping` <character> and `..2$grouping` <logical>.

Created on 2024-12-09 with reprex v2.1.1

@corybrunson corybrunson added the bug Something isn't working label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant