HeRAMS_create_hf_shapefile | R Documentation |
Create a point shapefile of health facilities based on a pre-processed HeRAMS health facility table obtained with the
HeRAMS_filter_hf
function.
HeRAMS_create_hf_shapefile(
mainPath,
location,
mostRecentBoundaries = TRUE,
lonlat = TRUE,
epsg = NULL,
rmNA = NULL,
rmOut = NULL,
scenario = NULL,
nameCSV = NULL
)
mainPath |
character; the parent directory of the location folder |
location |
character; the location folder name |
mostRecentBoundaries |
logical; should the most recent processed boundary shapefile be used? If FALSE and if there are multiple available inputs, the user is interactively asked to select the input based on file creation time. |
lonlat |
logical; are the coordinates indicated in the health facility table given in lon/lat? |
epsg |
numeric or character (coerced to character); ESPG code - Coordinate systems worldwide (EPSG/ESRI) |
rmNA |
logical; should the health facilities with non-available coordinates be removed? If NULL or FALSE the user is interactively asked whether they want to remove them or not. |
rmOut |
logical; should the health facilities falling outside of the location area be removed? If NULL or FALSE the user is interactively asked whether they want to remove them or not. |
scenario |
character; a string of three characters that correspond to the scenario folder suffix like '001', '002'...'010'...'099'...'100' If NULL, the user is interactively asked to choose the scenario from the available ones. |
nameCSV |
character; name of csv file WITHOUT extension corresponding to filtered facilities. If null, it will take the default name used in the HeRAMS_filter_hf function (health_facilities.csv). |
Once the missing coordinate issue is addressed, the function checks whether the health facilities fall within the location boundary. There is a track record of both the facilities with missing coordinates and the ones that fall outside the location boundary.
# Replace workDir with the actual path to your working directory
## Not run:
mainPath <- "workDir"
initiate_project(mainPath)
## End(Not run)
# Replace myLocation with the location name you are working on (workDir subfolder)
## Not run:
location <- "myLocation"
download_boundaries(mainPath, location, adminLevel = 1, type = "gbOpen", alwaysDownload = TRUE)
## End(Not run)
# Replace myHeRAMScodeTable with the path of the HeRAMS table that contains codes; set to NULL to use example data
# Replace myHeRAMStextTable with the path of the HeRAMS table that contains text; set to NULL to use example data
## Not run:
pathTableCode <- "myHeRAMScodeTable"
pathTableText <- "myHeRAMStextTable"
HeRAMS_filter_hf(mainPath, location, pathTableCode, pathTableText, barriers = FALSE, mostRecentObs = TRUE)
HeRAMS_create_hf_shapefile(mainPath, location, mostRecentBoundaries = TRUE, lonlat = TRUE, rmNA = TRUE, rmOut = TRUE, scenario = NULL)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.