# Define the split functionsplit_fun <- drop_split_levelslyt <-basic_table() %>%summarize_patients_events_in_cols(filters_list = filters_list,empty_stats =c("all", "related", "fatal", "fatal_related"),custom_label ="Total number of patients with at least one serious adverse event" ) %>%split_rows_by("AEBODSYS",nested =FALSE,split_fun = split_fun,indent_mod =-1L,label_pos ="topleft",split_label =obj_label(adae_serious_arm$AEBODSYS) ) %>%split_rows_by("AEDECOD",split_fun = split_fun,label_pos ="topleft",split_label =obj_label(adae_serious_arm$AEDECOD) ) %>%summarize_patients_events_in_cols(filters_list = filters_list,col_split =FALSE )result <-build_table(lyt, adae_serious_arm)result
Body System or Organ Class
Dictionary-Derived Term Patients (All) Events (All) Events (Related) Events (Fatal) Events (Fatal & Related)
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Total number of patients with at least one serious adverse event 104
cl A.1
dcd A.1.1.1.2 48 68 0 0 0
cl B.1
dcd B.1.1.1.1 47 56 56 56 56
cl B.2
dcd B.2.2.3.1 48 64 0 0 0
cl D.1
dcd D.1.1.1.1 50 61 61 61 61
Experimental use!
WebR is a tool allowing you to run R code in the web browser. Modify the code below and click run to see the results. Altenatively, copy the code and click here to open WebR in a new tab.