Skip to content
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

Update collect.R #33

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Conversation

wangben718
Copy link
Collaborator

library(r2rtf)

meta <- metalite::meta_example()

meta$data_population$TRTA <- factor(meta$data_population$TRTA)
# Level SEX
meta$data_population$SEX <- factor(meta$data_population$SEX, levels = c("F", "M", "Unknown"))

meta <- meta |>
define_parameter(name = "sex", var = "SEX", label = "Sex")

collect_baseline(meta, "apat", "sex")

Expect output:

$pop
  name  Placebo Xanomeline Low Dose Xanomeline High Dose    Total var_label
1    F 61.62791            59.52381             47.61905 56.29921       Sex
2    M 38.37209            40.47619             52.38095 43.70079       Sex
3 Unknown 0               0                            0               0                SEX

Since refactor the SEX variable, output is not showing row for Unknown as expected.

$pop
  name  Placebo Xanomeline Low Dose Xanomeline High Dose    Total var_label
1    F 61.62791            59.52381             47.61905 56.29921       Sex
2    M 38.37209            40.47619             52.38095 43.70079       Sex

@wangben718 wangben718 merged commit c47d53e into main Jul 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants