-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
View Variables: Left hand vs. bar plot table "Missing" counts don't match #697
Comments
Empty strings are not missing values. NAs are missing values. |
Yes, that is my point as seen in the examples. |
Also, in the case of variable browser module. Empty strings are considered as missing values and they are converted into NA |
That would not be my guess so it sounds like a deliberate choice. What is your opinion as a user @npaszty? |
from our investigation it looks like !is.na() is used in this module to evaluate the counts (%)? we use the df_explicit_na() function to prep the clinical data for use in the teal modules but in this case it is not going to make an impact because of !is.na() used to evaluate the counts. from a user perspective the observation of two opposing displays is not comforting. 0 (0%) on the one hand and 466 (42.87%) on the other hand. these diffs will undermine confidence in the tool. users don't know of or react to computing approaches behind the scenes and their associated nuances, they just see what they see. 😄 if the outcome display is the result of a deliberate choice then I guess I would be curious to understand the rationale behind the choice. |
@npaszty Would you like to have the following behavior?
The proposed change will look like this, with the code to reproduce the outputpak::pak("insightsengineering/teal.modules.general@697-impute-empty-values-as-na@main")
library(teal.modules.general)
data <- teal_data()
data <- within(data, {
ADSL <- rADSL
ADSL$SEX <- factor(ADSL$SEX, levels = c("F", "M", ""))
ADSL$SEX[1:10] <- ""
attr(ADSL$SEX, "label") <- "Sex"
ADSL$RACE <- as.character(ADSL$RACE)
ADSL$RACE[1:20] <- ""
attr(ADSL$RACE, "label") <- "Race"
ADTTE <- rADTTE
})
join_keys(data) <- default_cdisc_join_keys[datanames(data)]
app <- init(
data = data,
modules = tm_variable_browser(
label = "Variable browser"
)
)
shinyApp(app$ui, app$server) P.S You can try this fix in your app by installing the tmg using this command: pak::pak("insightsengineering/teal.modules.general@697-impute-empty-values-as-na@main") |
not sure when an empty value would not be considered missing in practical terms and that's what I'm pointing out here. provided there isn't a broad impact that the core dev team would be able to identify then yes, the change you made displays the counts the way I would expect. thanks! |
What happened?
the "Missing" column count in the left hand table does not match the "Missing" record count in the table underneath the bar chart.
sessionInfo()
Relevant log output
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: