download_population | R Documentation |
Download a population raster from the World Pop FTP and copy it to its corresponding folder.
download_population(
mainPath,
location,
alwaysDownload = FALSE,
allowInteractivity = TRUE,
testMode = FALSE
)
mainPath |
character; the parent directory of the location folder |
location |
character; the location folder name |
alwaysDownload |
logical; should the raster always be downloaded, even if it has already been downloaded? If FALSE and if the raster has already been downloaded the user is interactively asked whether they want to download it again or not. |
allowInteractivity |
logical; whether to enable interactivity. |
testMode |
logical; to be ignored. Only used when testing the function with testthat. |
The function accesses the World Pop FTP and uses an internal function (navigate_ftp
) in order to interactively navigate
through the folders and select the population raster to be downloaded. The ISO code retrieved internally by the get_param
function
is used to match the country FTP folder when available. When allowInteractivity = FALSE, predefined parameters are set (see parameter details.)
# 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_population(mainPath, location, alwaysDownload = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.