mcanouil / eggla

Early Growth Genetics Longitudinal Analysis.
https://m.canouil.dev/eggla/
Other
2 stars 1 forks source link

Outlier plot legend getting mixed #79

Closed annihei closed 2 years ago

annihei commented 2 years ago

Bug description

I got that really nice outlier plot as an output from run_eggla_lmm(). The legend explaining colors seems to get mixed when I only have two different colors in my plot: derived-outliers

Looking at the "derived-ouliers.csv" from the same lot of output I have altogether 701 "Zscore outliers" and 1657 "IQR outliers", and actually all Zscore outliers are also IQR-outliers.

> table(outliers$Outlier_Zscore)

    0     1 
74658   701

> table(outliers$Outlier_IQR)

    0     1 
73702  1657 

> table(outliers$Outlier_IQR, outliers$Outlier_Zscore)

        0     1
  0 73702     0
  1   956   701

eggla version output

> packageVersion("eggla")
[1] ‘0.16.0’
> sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=Finnish_Finland.utf8  LC_CTYPE=Finnish_Finland.utf8    LC_MONETARY=Finnish_Finland.utf8
[4] LC_NUMERIC=C                     LC_TIME=Finnish_Finland.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] forcats_0.5.2     stringr_1.4.1     dplyr_1.0.10      purrr_0.3.5       readr_2.1.3       tidyr_1.2.1      
 [7] tibble_3.1.8      ggplot2_3.3.6     tidyverse_1.3.2   eggla_0.16.0      data.table_1.14.2

loaded via a namespace (and not attached):
 [1] cellranger_1.1.0    pillar_1.8.1        compiler_4.2.1      dbplyr_2.2.1        tools_4.2.1         lubridate_1.8.0    
 [7] jsonlite_1.8.0      googledrive_2.0.0   lifecycle_1.0.3     gargle_1.2.0        gtable_0.3.1        nlme_3.1-157       
[13] lattice_0.20-45     pkgconfig_2.0.3     rlang_1.0.6         reprex_2.0.2        DBI_1.1.3           cli_3.4.1          
[19] rstudioapi_0.14     patchwork_1.1.2     haven_2.5.1         xml2_1.3.3          withr_2.5.0         httr_1.4.4         
[25] hms_1.1.2           fs_1.5.2            generics_0.1.3      vctrs_0.4.2         googlesheets4_1.0.1 grid_4.2.1         
[31] tidyselect_1.2.0    glue_1.6.2          R6_2.5.1            fansi_1.0.3         readxl_1.4.1        tzdb_0.3.0         
[37] modelr_0.1.9        magrittr_2.0.3      ellipsis_0.3.2      scales_1.2.1        backports_1.4.1     rvest_1.0.3        
[43] assertthat_0.2.1    colorspace_2.0-3    utf8_1.2.2          stringi_1.7.8       munsell_0.5.0       broom_1.0.1        
[49] crayon_1.5.2       

Checklist

mcanouil commented 2 years ago

Yep, it's because one of the condition does not exist (on its own) and was not hardcoded as a level. This is no longer a problem in the new version just released, i.e. v0.17.0 (see https://github.com/mcanouil/eggla/releases/tag/v0.17.0), because now there is only one method used.

annihei commented 2 years ago

OK, I'll have a go with that one then!