Import mechanism specific info from DATIM
get_names.Rd
The Target Setting Tool does not contain information on the mechanism (names or partners). By running this function, you are connecting to DATIM's SQLView file that contains the list of all current mechanisms. This requires providing your DATIM credentials. If left blank in the function, you will have two dialogue boxes popping up asking for your DATIM username and password. If running `tame_dp()` across multiple Target Setting Tools, it's advisable to run `get_names()` on the file dataset produced by `tame_dp`.
Arguments
- df
data frame to add mechanism info to
- map_names
import names from DATIM (OU, mechanism, partner) associated with mech_code
- psnu_lvl
aggregate to the PSNU level instead of IM
- cntry
country, from grab_info() if not connecting to DATIM
- datim_user
DATIM user name (if not provided, you will be prompted with a pop up)
- datim_password
DATIM password (if not provided, you will be prompted with a pop up)
Examples
if (FALSE) {
#load package
library(purrr)
#identify all the Target Setting Tool files
files <- list.files("../Downloads/DataPacks", full.names = TRUE)
#read in all DPs and combine into one data frame
df_all <- map_dfr(.x = files,
.f = ~ tame_dp(.x, map_names = FALSE))
#apply mech_name and primepartner names from DATIM
#you will need to provide your DATIM credentials
datim_user_nm <- "spower" #replace with your username
datim_pwd <- getPass::getPass() #pop up prompting for your password
df_all <- get_names(df_all, datim_user = datim_user_nm, datim_password = datim_pwd)
}