#load libraries
pacman::p_load(
  tidyverse,
  readr,
  readxl,
  janitor,
  arsenal,
  haven,
  labelled,
  writexl
)
#set the current working directory
df<-readRDS(file="C:/Users/PEPFAR/Documents/Trainings/R Training/Project/Dataset/R/nhanes.RDS")
view(df)

#One way frequency table

table1<-df %>% 
  tabyl(region) %>% 
  adorn_totals() %>% 
adorn_pct_formatting(digits = 0) %>% 
rename_with(str_to_title)
#two way frequency table
table1

R Tabulation with Chi-square and Fisher’s exact test

rrr