Advertisement
yayopoint

crosstable example

Oct 1st, 2021
1,282
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. library(haven)
  2. library(multitabulation)
  3. library(flextable)
  4.  
  5. urlName <- "https://historico-amu.ine.cl/enut/files/db/BASE_DATOS_ENUT_spss.zip"
  6. temp <- tempfile()
  7. download.file(urlName,temp)
  8. ENUT <- read_spss(unzip(temp, "BASE_USUARIO_corregida.sav"))
  9.  
  10. unlink(temp)
  11.  
  12. as_factor(ENUT$f13_1_1)
  13.  
  14. crosstable(wgtH ~ as_factor(f13_1_1) + as_factor(f17_2_1), data=ENUT, stats=c("count", "column"), format=c("#.#0,0", "#.#0,0%")) %>%
  15.   as_flextable
Advertisement
RAW Paste Data Copied
Advertisement