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

order = "anyClass" argument of ggparcoord() function doesn't work when the dataset has missing values #497

Open
ShanikaLW opened this issue Apr 22, 2024 · 0 comments · May be fixed by #500

Comments

@ShanikaLW
Copy link

ShanikaLW commented Apr 22, 2024

If I set order = "anyClass in the ggparcoord() function when the dataset has missing values, the function doesn't work. Below is a MWE.

library(palmerpenguins)
#> Warning: package 'palmerpenguins' was built under R version 4.3.3
library(GGally)
#> Warning: package 'GGally' was built under R version 4.3.3
#> Loading required package: ggplot2
#> Warning: package 'ggplot2' was built under R version 4.3.3
#> Registered S3 method overwritten by 'GGally':
#>   method from   
#>   +.gg   ggplot2

penguins %>% 
  ggparcoord(columns = 3:4, groupColumn = "species", order = "anyClass")
#> Error in model.frame.default(formula = x ~ as.factor(classVar == class.names[i]), : variable lengths differ (found for 'as.factor(classVar == class.names[i])')

Created on 2024-04-22 with reprex v2.1.0
`

It is inherited from the singleClassOrder() function. It has two arguments, classVar, and axisVars. Indices corresponding to classVar are removed, however they are not removed from axisVars.

@ShanikaLW ShanikaLW changed the title order = "anyClass" argument of ggparcoord() function doesn't work when there are missing values order = "anyClass" argument of ggparcoord() function doesn't work when the dataset has missing values Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant