extractWP: Extract WorldPop UK Raster Sets for all locations from a...

Description Usage Arguments Author(s) References Examples

View source: R/extractWP.R

Description

You must have run an spheat function (spheatNAMES, spheatGPS, or spheatLOOKUP) to exercise this function.

Usage

1
2
extractWP(datatype, options, year, gadmlevel = "lowest", fill = TRUE,
  deleteRAST = TRUE, outdata = MASTERout, geolist = MASTERgeo)

Arguments

datatype

(character), the datatype you would like to see what options are available for WorldPop UK data. The available datatypes can be attained with the function getWPdatatypes() Example datatypes: “Population” or “Stunting”

options

(character), the options of the tif dataset you would like to download. The available options can be attained with the function getWPoptions() e.g. “ppp” or c(“F”, "interdecile")

year

(numeric), the year of the dataset you would like to download. Available years are given by the getWPoptions() function for any given country.

gadmlevel

(integer or character), either an integer level gadm level to extract for all countries in MASTERout, or one of gadmlevel="lowest" for the lowest respective gadm level available or gadmlevel="lcl" for lowest COMMON level among all countries in MASTERout. Default is gadmlevel="lowest"

fill

(logical), if extraction values for all higher gadm geographic level values should also be returned. I.e. if gadmlevel=3 and fill=TRUE, extractWP will return the extraction values for gadm levels 0, 1, 2, and 3. If fill=FALSE in this case, extractWP will only return extraction values for gadm level 3. See gadm.org for details about levels (in short level 0 is always country, 1 is state/province/equivalent, 2 is county/municipality/equivalent, 3 is village/equivalent, 4 and more get into blocks and other lower geographic levels). Default is fill=TRUE

deleteRAST

(logical), logical if the downloaded WorldPop UK Raster sets should be deleted when they are done being analyzed. Reccomended TRUE for datasets containing many countries as TRUE deletes the done analyzed raster before a new one is downloaded, minimizing disk space use. Default is deleteRAST=TRUE

Author(s)

Neal Thomas Barsch

References

GADM DATA are attained through the GADM project website. Commercial use of this function is not allowed without prior permission from GADM.org. http://gadm.org/.

WorldPop UK data are attained through the WorldPop UK website. These data are licensensed under the Creative Commons Attribution 4.0 License. http://www.worldpop.org.uk/.

Eternal grattitude to StackOverflow member hrbrmstr who contributed crucially to the code for the downloads from WorldPop.

Examples

1
2
3
4
5
6
extractWP(datatype="Births", options="pp", year=2015, gadmlevel="lowest", fill=TRUE, deleteRAST=TRUE)

extractWP(datatype="Population", options=c("ppp", "adj"), year=2010, gadmlevel="lowest", fill=TRUE, deleteRAST=TRUE)

#You dont want to delete the Raster files (warning, could take a lot of storage space if not deleted)
extractWP(datatype="Births", options="pp", year=2015,deleteRAST=FALSE)

nbarsch/spaceheater documentation built on Sept. 3, 2021, 6:13 a.m.