Why tbl_summary() function is not found even though I have installed gtsummary packages

41 Views Asked by At

I would like to create a table of summary statistics for Patient baseline demographics, and clinical characteristics overall with R studio

In R studio, I am working in Rmarkdown I have installed packages:

Loading useful packages

pacman::p_load(
    dplyr,
    readxl,
    ggplot2,
    tidyr,
    gtsummary
    )

Then I have selected the variables I would like to have some statistics about and apply the tbl_summary function:

tsum <- df %>%
    select(gender,
           age,
           ethnicity,
           level_educ,
           marital_status,
           sociopro_class,
           alcohol,
           smoker,
           bmi_ctgcbm,
           ncds,
           stge_hiv
           ) %>% 
    tbl_summary()

I was not expecting this error message: Error in tbl_summary(.) : could not find function "tbl_summary"

0

There are 0 best solutions below