Skip to contents

Create a report chunk for demography indicators

Usage

report_op_demo(format = "html")

Arguments

format

Either html, docx or odt. Defaults to html.

Value

A reporting chunk for demographic indicators

Author

Ernest Guevarra

Examples

  report_op_demo()
#> 
#> # Sample description
#> 
#> ## Type of respondents
#> ```{r respondentTable}
#> knitr::kable(x = resultsDF[1:4, ],
#>   caption = 'Type of respondent',
#>   booktabs = TRUE,
#>   digits = 2,
#>   col.names = c('Indicator', 'Type', 'Est', '95% LCL', '95% UCL', 'Est', '95% LCL', '95% UCL', 'Est', '95% LCL', '95% UCL')) %>%
#>   kableExtra::kable_styling(bootstrap_options = c('striped')) %>%
#>   kableExtra::add_header_above(c(' ' = 2, 'ALL' = 3, 'MALES' = 3, 'FEMALES' = 3))
#> ```
#> 
#> ## Age structure by sex
#> ```{r agePlot}
#> oldr::chart_age(x = oldr::create_op_all(svy = svy), save_chart = FALSE)
#> ```
#> 
#> ```{r ageTable}
#> knitr::kable(x = resultsDF[5:10, ],
#>   caption = 'Respondent age group by sex',
#>   booktabs = TRUE,
#>   digits = 2,
#>   col.names = c('Indicator', 'Type', 'Est', '95% LCL', '95% UCL', 'Est', '95% LCL', '95% UCL', 'Est', '95% LCL', '95% UCL')) %>%
#>   kableExtra::kable_styling(bootstrap_options = c('striped')) %>%
#>   kableExtra::add_header_above(c(' ' = 2, 'ALL' = 3, 'MALES' = 3, 'FEMALES' = 3))
#> ```
#> 
#> ## Respondents by sex
#> ```{r sexTable}
#> knitr::kable(x = resultsDF[11:12, ],
#>   caption = 'Sex of respondents',
#>   booktabs = TRUE,
#>   digits = 2,
#>   col.names = c('Indicator', 'Type', 'Est', '95% LCL', '95% UCL', 'Est', '95% LCL', '95% UCL', 'Est', '95% LCL', '95% UCL')) %>%
#>   kableExtra::kable_styling(bootstrap_options = c('striped')) %>%
#>   kableExtra::add_header_above(c(' ' = 2, 'ALL' = 3, 'MALES' = 3, 'FEMALES' = 3))
#> ```
#> 
#> ## Marital status of respondents
#> ```{r marriedTable}
#> knitr::kable(x = resultsDF[13:19, ],
#>   caption = 'Marital status',
#>   booktabs = TRUE,
#>   digits = 2,
#>   col.names = c('Indicator', 'Type', 'Est', '95% LCL', '95% UCL', 'Est', '95% LCL', '95% UCL', 'Est', '95% LCL', '95% UCL')) %>%
#>   kableExtra::kable_styling(bootstrap_options = c('striped')) %>%
#>   kableExtra::add_header_above(c(' ' = 2, 'ALL' = 3, 'MALES' = 3, 'FEMALES' = 3))
#> ```