This file contains hidden or 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
# PROJECT: agitprop | |
# PURPOSE: site count of USAID supported facilities | |
# AUTHOR: A.Chafetz | USAID | |
# REF ID: 74bbe262 | |
# LICENSE: MIT | |
# DATE: 2024-12-02 | |
# UPDATED: | |
# NOTE: based on https://github.com/USAID-OHA-SI/agitprop/blob/main/Scripts/archive/02_usaid_sites.R | |
# DEPENDENCIES ------------------------------------------------------------ |
This file contains hidden or 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
# PROJECT: | |
# PURPOSE: QC ZIM 3rd 95 | |
# AUTHOR: A.Chafetz | USAID | |
# REF ID: d3dbf219 | |
# LICENSE: MIT | |
# DATE: 2024-09-10 | |
# UPDATED: | |
# DEPENDENCIES ------------------------------------------------------------ | |
This file contains hidden or 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
#storing a list of vectors and matching against them | |
library(tidyverse) | |
#create file name for dummy dataset outputs | |
set.seed(42) | |
files <- sample(fruit, 3) %>% | |
map_chr(~str_glue("{tempdir()}\\{.x}.csv")) | |
#create three dummy datasets | |
tibble(a = runif(5), |
This file contains hidden or 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
gen_json <- function(pal_num, folderpath_out = NULL){ | |
v_pal <- names(glitr::si_palettes[pal_num]) | |
l_col <- glitr::si_palettes[pal_num] |>unlist() | |
v_col <- glue::glue('"{l_col}"') |> glue::glue_collapse(sep = ', ') | |
glue::glue('"{v_pal}": [{v_col}],\n') |
This file contains hidden or 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
library(tidyverse) | |
library(glamr) | |
library(gophr) | |
#path to the file | |
msd_path <- si_path() %>% | |
return_latest("TRAINING") | |
#get medata from MSD (idnetify FY and Qtr) |
This file contains hidden or 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
# PROJECT: | |
# PURPOSE: rube goldberg in ggplot | |
# AUTHOR: A.Chafetz | USAID | |
# REF ID: ea15d69e | |
# LICENSE: MIT | |
# DATE: 2024-07-18 | |
# UPDATED: | |
# DEPENDENCIES ------------------------------------------------------------ | |
This file contains hidden or 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
# PROJECT: dexters_laboratory | |
# PURPOSE: | |
# AUTHOR: A.Chafetz | USAID | |
# REF ID: daee2cf4 | |
# LICENSE: MIT | |
# DATE: 2024-04-16 | |
# UPDATED: | |
# DEPENDENCIES ------------------------------------------------------------ | |
This file contains hidden or 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
#Demonstrating datapasta plugin | |
#https://milesmcbain.github.io/datapasta/ | |
# INSTALL ----------------------------------------------------------------- | |
# install.packages("datapasta", | |
# repos = c(mm = "https://milesmcbain.r-universe.dev", | |
# getOption("repos"))) | |
This file contains hidden or 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
# PROJECT: | |
# PURPOSE: | |
# AUTHOR: A.Chafetz | USAID | |
# REF ID: 97a36055 | |
# LICENSE: MIT | |
# DATE: 2024-03-19 | |
# UPDATED: | |
# DEPENDENCIES ------------------------------------------------------------ | |
This file contains hidden or 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
export_plot <- function(name){ | |
{name} %>% | |
paste0(c(".png", ".svg")) %>% | |
as_tibble_col(column_name = "file") %>% | |
mutate(folder = c("Images", "Graphics")) %>% | |
pwalk(~si_save(..1, path = ..2)) | |
} |
NewerOlder