I am having trouble creating building the list-of-lists to pass to the summaries argument of summary_table. When I go to use the summary_table function, it returns
"Error:
xmust be a formula"
summary_test <- list("Gender" =
list("Female" = ~ qwraps2::n_perc0(.mydata$sex == "F"),
"Male" = ~ qwraps2::n_perc0(.mydata$sex == "M")),
"Age" =
list("Mean" = ~ qwraps2::mean_sd(.mydata$age, denote_sd = "paren")),
"Comorbidities" =
list("HIV Positive" == ~ qwraps2::n_perc0(.mydata$hiv == 1),
"Type 2 Diabetes" == ~ qwraps2::n_perc0(.mydata$diabetes == 1)))
whole <- summary_table(mydata, summary_test)
can't reproduce without your data, but it looks like you wrote
==instead of=in the last list. Try: