Title: | Masks and houses the PEPFAR MSD-style training dataset for testing and training |
---|---|
Description: | This package creates and hosts a masked, dummy dataset that should be used for testing, training, and demoing instead of using actual PEPFAR data. |
Authors: | Aaron Chafetz [aut, cre], Tim Essam [ctb] |
Maintainer: | Aaron Chafetz <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.5 |
Built: | 2024-10-31 04:36:41 UTC |
Source: | https://github.com/USAID-OHA-SI/themask |
This table has been extracted from Wikipedia's Minor League Baseball (MiLB) page and is used for masking geographic and partner information in PEPFAR's MER Structured Datasets (MSD).
milb
milb
milb
A data frame with 120 rows and 6 columns:
MLB Division (East, Central, West)
Affiliated MLB
MilB team level (High A, A, AA, AAA)
MilB team level (varies by level)
MilB team city/location
MilB team name
https://en.wikipedia.org/wiki/Minor_League_Baseball
This table mimics the structure of PEPFAR's MER Structured Datasets (MSD).
The dummy dataset for the (Kingdom of) Minoria has four region (snu1
), each
containing four districts (psnu
). Derived from milb
.
minoria_geo
minoria_geo
minoria_geo
A data frame with 16 rows and 7 columns:
Operating Unit name (Minoria)
OU unique ID (Minoria)
Country (Minoria)
Sub-National Unit 1 level below national (from MiLB league)
SNU1 unique ID
Priority SNU (from MiLB city)
PSNU unique ID
This table mimics the structure of PEPFAR's MER Structured Datasets (MSD) for
mechanims, which originally originate from FACTInfo NextGen. The dummy
dataset for the (Kingdom of) Minoria has 120 (plus two dedup) mechanisms
available for use. Derived from milb
.
minoria_mechs
minoria_mechs
minoria_mechs
A data frame with 122 rows and 7 columns:
Unique implementing mechanism code
implementing mechanism code (from MiLB team name)
implementing mechanism partner (from MiLB team name)
This dataset is the sf file for mapping (Kingdom of) Minoria at the national level
minoria_shp_ou
minoria_shp_ou
minoria_shp_ou
A data frame with 16 rows and 7 columns:
OU unique ID (Minoria)
Operating Unit name (Minoria)
Country (Minoria)
Country level polygon shape for mapping
Other shp:
minoria_shp_psnu
,
minoria_shp_snu1
This dataset is the sf file for mapping (Kingdom of) Minoria by PSNU.
minoria_shp_psnu
minoria_shp_psnu
minoria_shp_psnu
A data frame with 16 rows and 8 columns:
Priority SNU (from MiLB city)
PSNU unique ID
Sub-National Unit 1 level below national (from MiLB league)
SNU1 unique ID
Operating Unit name (Minoria)
OU unique ID (Minoria)
Country (Minoria)
PSNU level polygon shape for mapping
Other shp:
minoria_shp_ou
,
minoria_shp_snu1
This dataset is the sf file for mapping (Kingdom of) Minoria by SNU1.
minoria_shp_snu1
minoria_shp_snu1
minoria_shp_snu1
A data frame with 4 rows and 6 columns:
SNU1 unique ID
Sub-National Unit 1 level below national (from MiLB league)
Operating Unit name (Minoria)
OU unique ID (Minoria)
Country (Minoria)
SNU1 level polygon shape for mapping
Other shp:
minoria_shp_ou
,
minoria_shp_psnu
This function is used to check what masked version is currently available and
will flag if there it is up to date or you should run msk_create
yourself.
It will also list all available historic releases that can be downloaded in
msk_download
by specifying the version in the tag param.
msk_available()
msk_available()
Other download:
msk_download()
This function is used to create a masked dataset for use in testing and training. The data are subset to 16 PSNUs and masked across geographic and mechanism variables. Either the PSNUxIM or NAT_SUBNAT Structured Datasets can be masked.
msk_create(filepath, output_folder)
msk_create(filepath, output_folder)
filepath |
path to the PSD file (PSNUxIM or NAT_SUBNAT) |
output_folder |
location where you want to store the new file (default = does not export the data) |
dataframe with converted geography + mech info
## Not run: #create a masked dataset library(glamr) library(themask) #store path to latest MSD path <- si_path() %>% return_latest("PSNU_IM") #create a masked dataset from the PSNUxIM MSD msk_create(path, "project1/data") ## End(Not run)
## Not run: #create a masked dataset library(glamr) library(themask) #store path to latest MSD path <- si_path() %>% return_latest("PSNU_IM") #create a masked dataset from the PSNUxIM MSD msk_create(path, "project1/data") ## End(Not run)
This function download a masked dataset from GitHub
(USAID-OHA-SI/themask) for use in
training or testing. Recommend running msk_available
to see what version
is available to download.
msk_download(folderpath, tag = "latest", launch = FALSE)
msk_download(folderpath, tag = "latest", launch = FALSE)
folderpath |
where should the file be downloaded to? |
tag |
version tag, default = "latest" |
launch |
whether to launch Windows Explorer to the location after the download completes (default = FALSE) |
msk_available
Other download:
msk_available()
## Not run: #check available version msk_available() #download to your downloads folder msk_download("~/Downloads") ## End(Not run) ## Not run: #download an older version msk_download("~/Downloads", tag = "2023.06.27c") ## End(Not run)
## Not run: #check available version msk_available() #download to your downloads folder msk_download("~/Downloads") ## End(Not run) ## Not run: #download an older version msk_download("~/Downloads", tag = "2023.06.27c") ## End(Not run)
This function is used to create a unique ID (UID) to mimic the UIDs created and used by DATIM for the MER and other PEPFAR Structured Datasets.
msk_gen_uid(codeSize = 11)
msk_gen_uid(codeSize = 11)
codeSize |
character length for UID output (default = 11) |
random alphanumeric string
msk_gen_uid()
msk_gen_uid()
This function is used to upload the new masked dataset to GitHub
(USAID-OHA-SI/themask) so that others can use it. This function is for
package developers use only. The data from msk_create()
are subset to
16 PSNUs and masked across geographic and mechanism variables. Either the
PSNUxIM or NAT_SUBNAT Structured Datasets can be masked.
msk_release(filepath, output_folder)
msk_release(filepath, output_folder)
filepath |
path to the PSD file (PSNUxIM or NAT_SUBNAT) or masked file |
output_folder |
location where you want to store the new file (default does not save the file) |
dataframe with converted geography + mech info
msk_create
## Not run: #create and upload a new release library(glamr) library(themask) #store path to latest MSD path <- si_path() %>% return_latest("PSNU_IM") #create a masked dataset from the PSNUxIM MSD msk_release(path, "project1/data") ## End(Not run) ## Not run: #upload release from an existing masked dataset library(glamr) library(themask) #store path to masked dataset path_msk <- return_latest("project1/data","TRAINING") #create a masked dataset from the PSNUxIM MSD msk_release(path_msk) ## End(Not run)
## Not run: #create and upload a new release library(glamr) library(themask) #store path to latest MSD path <- si_path() %>% return_latest("PSNU_IM") #create a masked dataset from the PSNUxIM MSD msk_release(path, "project1/data") ## End(Not run) ## Not run: #upload release from an existing masked dataset library(glamr) library(themask) #store path to masked dataset path_msk <- return_latest("project1/data","TRAINING") #create a masked dataset from the PSNUxIM MSD msk_release(path_msk) ## End(Not run)