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

Example for edc_data_stop() #51

Open
DanChaltiel opened this issue Jul 9, 2024 · 0 comments
Open

Example for edc_data_stop() #51

DanChaltiel opened this issue Jul 9, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@DanChaltiel
Copy link
Owner

For the future vignette.

If you use dplyr::case_when() to create a categorical variable and all cases should be handled, then you can use .default="ERROR and stop if there is any.

df = trial %>% 
  mutate(
    event_pfs_detail = case_when(
      !is.na(time_prog) ~ "Progression", 
      !is.na(time_death) ~ "Death",
      !is.na(time_pfs) ~ "Censored",
      .default="ERROR"
    ),
  )

df %>% 
  filter(event_pfs_detail=="ERROR") %>% 
  edc_data_stop("Error on primary endpoint !")
@DanChaltiel DanChaltiel added the documentation Improvements or additions to documentation label Jul 9, 2024
@DanChaltiel DanChaltiel added this to the v0.5.0 milestone Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant