We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
xportr_order
Dear developer,
when the input data is grouped, the xportr_order get wrong results as shown in below example.
adsl %>% group_by(USUBJID)
Adding missing grouping variables: USUBJID
USUBJID
grouped data frame
sometimes the user will forget to ungroup the final data frame, then calling the function xportr_order get wrong output.
if the function can check the input data frame is grouped or not, or ungroup the input data frame inside the function.
library(dplyr,warn.conflicts = FALSE) library(xportr) adsl <- data.frame( BRTHDT = c(1, 1, 2), STUDYID = c("mid987650", "mid987650", "mid987650"), TRT01A = c("Active", "Active", "Placebo"), USUBJID = c(1001, 1002, 1003) ) %>% group_by(USUBJID) metadata <- data.frame( dataset = c("adsl", "adsl", "adsl", "adsl"), variable = c("STUDYID", "USUBJID", "TRT01A", "BRTHDT"), order = 1:4 ) adsl <- xportr_order(adsl, metadata, domain = "adsl") #> Adding missing grouping variables: `USUBJID` #> New names: #> Warning in names(df_re_ord) != names(.df): longer object length is not a #> multiple of shorter object length #> #> ── 1 variables not in spec and moved to end ── #> #> ── 4 reordered in dataset ──
Created on 2024-05-16 with reprex v2.1.0
The text was updated successfully, but these errors were encountered:
perhaps we should issue an error that the dataset is grouped and ask users to ungroup?
@atorus-research/xportr-development-team what do you think?
Sorry, something went wrong.
No branches or pull requests
Feature Idea
Dear developer,
when the input data is grouped, the
xportr_order
get wrong results as shown in below example.adsl %>% group_by(USUBJID)
Relevant Input
grouped data frame
Relevant Output
sometimes the user will forget to ungroup the final data frame, then calling the function
xportr_order
get wrong output.if the function can check the input data frame is grouped or not, or ungroup the input data frame inside the function.
Reproducible Example/Pseudo Code
Created on 2024-05-16 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: