Generate an html / pdf country factsheet
Source:R/template_ctryfactsheet.R
template_CtryFactsheet.Rd
This functions provides a quick access to a basic Statistical Fact sheet template that can be customised according to the needs
Arguments
- year
Numeric value of the year (for instance 2022)
- country_asylum_iso3c
Character value with the ISO-3 character code of the Country of Asylum
- folder
folder within your project where to put the generated report. Folder will be created if it does not exist
Examples
## generate for one country
# template_CtryFactsheet(year = 2022, country_asylum_iso3c = "USA", folder = "Report")
# ## Generate for a specific region
# region <- "Americas"
# year <- 2022
# library(tidyverse)
# ## get all countries with more than 1000 Reported individuals
# ctr <- dplyr::left_join( x= ForcedDisplacementStat::end_year_population_totals_long,
# y= ForcedDisplacementStat::reference,
# by = c("CountryAsylumCode" = "iso_3")) |>
# filter(Year == year &
# UNHCRBureau == region ) |>
# group_by( CountryAsylumName, CountryAsylumCode ) |>
# summarise(Value = sum(Value) ) |>
# ungroup() |>
# filter( Value > 1000 )
#
# for ( i in (1:nrow(ctr))) {
# # i <- 1
# country_asylum_iso3ci = as.character(ctr[i ,2 ])
# cat(paste0(country_asylum_iso3ci, "\n"))
# unhcrdatapackage::template_CtryFactsheet(year = 2022,
# country_asylum_iso3c = country_asylum_iso3ci,
# folder = "Report") }