Expectation is that we will get the choices in a sorted order: "large", "medium", "small"
But, we get: "small", "medium", "large" which is the order observed in the raw data.
sessionInfo()
No response
Relevant log output
No response
Code of Conduct
[X] I agree to follow this project's Code of Conduct.
Contribution Guidelines
[X] I agree to follow this project's Contribution Guidelines.
Security Policy
[X] I agree to follow this project's Security Policy.
What happened?
The factor and ordered choices are not sorted anymore. They used to be sorted before.
Sample app to reproduce the error
```r library(teal) library(shiny) library(scda) devtools::load_all("teal.slice") ADSL <- synthetic_cdisc_data("latest")$adsl ADSL$empty <- NA ADSL$logical1 <- FALSE ADSL$logical <- sample(c(TRUE, FALSE), size = nrow(ADSL), replace = TRUE) ADSL$numeric <- rnorm(nrow(ADSL)) ADSL$numeric_categorical <- sample(1:3, size = nrow(ADSL), replace = TRUE) ADSL$categorical <- sample(letters[1:10], size = nrow(ADSL), replace = TRUE) ADSL$ordered <- ordered(sample(letters[1:10], size = nrow(ADSL), replace = TRUE)) ADSL$date <- Sys.Date() + seq_len(nrow(ADSL)) ADSL$datetime <- Sys.time() + seq_len(nrow(ADSL)) * 3600 * 12 ADSL$factor <- factor(sample(letters[1:4], size = nrow(ADSL), replace = TRUE)) ADSL$numeric[sample(1:nrow(ADSL), size = 10, )] <- NA ADSL$numeric[sample(1:nrow(ADSL), size = 10, )] <- Inf ADSL$numeric[sample(1:nrow(ADSL), size = 10, )] <- NA ADSL$logical[sample(1:nrow(ADSL), size = 10, )] <- NA ADSL$date[sample(1:nrow(ADSL), size = 10, )] <- NA ADSL$datetime[sample(1:nrow(ADSL), size = 10, )] <- NA ADSL$categorical[sample(1:nrow(ADSL), size = 10, )] <- NA ADTTE <- synthetic_cdisc_data("latest")$adtte ADRS <- synthetic_cdisc_data("latest")$adrs app <- init( data = teal_data(ADSL = ADSL, ADTTE = ADTTE, ADRS = ADRS), modules = list(example_module()), filter = teal_slices( teal_slice("ADSL", "empty"), teal_slice("ADSL", "logical1"), teal_slice("ADSL", "logical"), teal_slice("ADSL", "numeric"), teal_slice("ADSL", "numeric_categorical"), teal_slice("ADSL", "categorical"), teal_slice("ADSL", "ordered"), teal_slice("ADSL", "factor"), teal_slice("ADSL", "date"), teal_slice("ADSL", "datetime") ) ) runApp(app) ```Expectation is that we will get the choices in a sorted order:
"large", "medium", "small"
But, we get:"small", "medium", "large"
which is the order observed in the raw data.sessionInfo()
No response
Relevant log output
No response
Code of Conduct
Contribution Guidelines
Security Policy