-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebcb4a4
commit 6a79e1a
Showing
43 changed files
with
825 additions
and
127 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# WARNING - Generated by {fusen} from dev/dev_unhcr_programme.Rmd: do not edit by hand | ||
|
||
|
||
# usethis::use_rmarkdown_template( | ||
# template_name = "iati_prez", | ||
# template_dir = NULL, | ||
# template_description = "UNHCR IATI", | ||
# template_create_dir = TRUE | ||
# ) | ||
|
||
|
||
#' Generate a summary powerpoint | ||
#' | ||
#' @param year A numeric value corresponding to the first year of focus until the most recent year within the dataset. | ||
#' @param ctr_name A character vector corresponding to the name of the country. | ||
#' @param folder folder within your project where to put the generated report. | ||
#' Folder will be created if it does not exist | ||
#' | ||
#' @importFrom unhcrdown pptx_slides | ||
#' @importFrom dplyr filter select pull | ||
#' @importFrom rmarkdown render | ||
#' @importFrom here here | ||
#' | ||
#' @return nothing the file for the report is generated | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' | ||
#' ## generate for one country | ||
#' # iati::template_prez(year = 2022, | ||
#' # ctr_name = "Brazil", | ||
#' # folder = "dev/Prez") | ||
#' | ||
#' # ## Generate for all operation specific region | ||
#' # region <- "The Americas" | ||
#' # | ||
#' # countries <- iati::dataActivity |> | ||
#' # dplyr::filter( unhcr_region == region) |> | ||
#' # dplyr::select(ctr_name) |> | ||
#' # dplyr::distinct() |> | ||
#' # dplyr::pull() | ||
#' # | ||
#' # for ( ctr in countries) { | ||
#' # cat(paste0(ctr, "\n")) | ||
#' # iati::template_prez(year = 2022, | ||
#' # ctr_name = ctr, | ||
#' # folder = "dev/Prez") } | ||
template_prez <- function(year = 2022, | ||
ctr_name, | ||
folder = "Prez") { | ||
|
||
## Create the outfolder if it does not exist | ||
output_dir <- paste0(getwd(),"/",folder) | ||
if (!dir.exists(output_dir)) {dir.create(output_dir)} | ||
|
||
rmarkdown::render( | ||
system.file("rmarkdown/templates/iati_prez/skeleton/skeleton.Rmd", package = "iati"), | ||
output_file = here::here(folder, paste0('iati_prez-', ctr_name, '-', year, '.pptx') ), | ||
params = list(ctr_name = ctr_name, | ||
year = year) ) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.