The package is used to create the data output that underlies the ICPI Partner Progress Reports (PPRs) which are generated twice a quarter (initial and post-cleaning). Historically, the data was created in Stata and required slight tweaks every quarter. Starting with FY18Q1, the scripts were converted into a automated package. The output is then used to populate an Excel template via VBA and the reports are then posted to PEPFAR Sharepoint.
- Install the package
#install
install.packages("devtools")
devtools::install_github("achafetz/PartnerProgress")
#load package
library("genPPR")
- Setup folder - Clone this repository to your local machine to have most of the folder structure and some data.
#setup any missing folders
initialize_fldr(projectname = "PartnerProgress", #don't change this line
projectpath"~/GitHub", #change to match where you want the project folder created locally
"RawData", "Documents", "R", "ExcelOutput", "Reports") #don't change this line
- Download the current ICPI MER Structured PSNUxIM dataset from the Data Store on PEPFAR Sharepoint. You will need to convert it to an rds file prior to running this package. You can save the rds file in the
RawData
folder.
#convert MSD from .txt to .rds
devtools::install_github("ICPI/ICPIutilities")
ICPIutilities::read_msd("~/Data/ICPI_MER_Structured_Dataset_OU_IM_FY17-18_20180515_v1_1")
If you want to run this with an inprocess dataset from DATIM, you will need to run the match_msd()
function from ICPIUtilities
to have the correct file name and saved as an rds.
#ALTERNATIVE: IF USING IN PROCESS DATA FROM DATIM
devtools::install_github("ICPI/ICPIutilities")
ICPIutilities::match_msd("~/Downloads/PEPFAR-Data-Genie-OUByIMs-2018-11-13.zip")
PEPFAR-Data-Genie-OUByIMs-2018-11-13
- Create the PPR dataset - run the main script,
genPPR()
from the package to create the underlying dataset that feeds into the template
#create global and OU output
genPPR("~/ICPI/Data", folderpath_output = "~/ExcelOutput")
#alternatively, you can just create a specific OU output
genPPR("~/ICPI/Data",
output_global = FALSE,
output_ctry_all = FALSE,
df_return = FALSE,
folderpath_output = "~/ExcelOutput",
output_subset_type = "ou",
"Kenya")
#or generate "global" files that contain one or many implementing partners
genPPR("~/ICPI/Data",
output_global = FALSE,
output_ctry_all = FALSE,
df_return = FALSE,
folderpath_output = "~/ExcelOutput",
output_subset_type = "mechid",
c("18045", "17097")
)
#or just the global output
genPPR("~/ICPI/Data", output_ctry_all = FALSE, folderpath_output = "~/ExcelOutput",)
===
Disclaimer: The findings, interpretation, and conclusions expressed herein are those of the authors and do not necessarily reflect the views of United States Agency for International Development, Centers for Disease Control and Prevention, Department of State, Department of Defense, Peace Corps, or the United States Government. All errors remain our own.