-
Notifications
You must be signed in to change notification settings - Fork 60
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
Feature Request: Can we add a setting to convert all missing character variable to "" instead of NA #2466
Comments
Hi @WangLaoK , Such a function is already available: convert_na_to_blanks() Please note that all admiral functions assume that a missing character value (in CDISC sense) is represented as |
Hi @bundfussr , I agree with you we treat blanks string and NA as different types in R environment, . But I think if we convert the data to XPT(For submission), then they will be treated as "" for all. ( XPT don't have NA for object type). Then this may cause a lot of messy in define.xml rule/derivation and not good for reviewer to see two or more conditions for a missing rule. For example, when I want to do some post process to handle both NA and "" records from BASEC and derive another variable DTYPE BR, |
Hi @WangLaoK thanks for the Feature Request. I'm wondering why you would allow NAs and blanks into a variable that represent the same thing? You should just pick one and I really recommend using NAs. For submission - I would keep the derivations in the define language agnostic so an FDA Reviewer can use the tools in SAS or R to follow along with your derivation. |
@WangLaoK , if you need to read in a xpt file, I would call convert_blanks_to_na directly after that. Then you can use a single condition ( |
Hi @bundfussr and @bms63 thank you for suggestions. But I still prefer to have a setting to avoid different type of missing value when we create ADaM variables. |
Hi @WangLaoK , some of the admiral functions like I don't like to add a global setting for specifying whether Just considering |
@bundfussr , in the final R data (e.g. adsl.rds to be used in TFLs), do you also suggest to present missing as |
Yes, I think it makes sense to use the same approach in all programs (SDTMs, ADaMs, and TLFs). I'm not sure if we need to add anything to the review guidance because it depends on which tools are used by the HA. If they have their own tools which represent a missing value as |
Hi @bundfussr , thank you so much for your time. I will follow the guidance when I use admiral packages. please close the issue. |
Feature Idea
By default, admiral package will derive NA for missing character variables.
e.g.: if paramcd/param not mapped for a derive_vars_merged_lookup() function.
However, character variables should be "" instead of NA there.
could we add below code or add some global setting to ensure all characters variable use "" instead of NA.
na2blank <- function(x){x <- ifelse(is.character(x) & is.na(x),"",x)}
Relevant Input
No response
Relevant Output
No response
Reproducible Example/Pseudo Code
No response
The text was updated successfully, but these errors were encountered: