popRFdemo: Function to demo the popRF package using WorldPop input data.

Description Usage Arguments Value References Examples

View source: R/popRFdemo.R

Description

This function allows the user to generate a population layer using the WorldPop geospatial covariates and subnational census-based population estimates for 230 countries. All input datasets use a geographical coordinate system (GCS) with WGS 1984 datum (EPSG:4326) in Geotiff format at a resolution of 3 arc-second (0.00083333333 decimal degree, approximately 100m at the equator). Mastergrid of sub-national administrative unit boundary was rasterised by CIESIN.

Following covariates will be downloaded and used to disaggregat population (2020 year) from census units into grid cells.

All downloaded files will be saved into subdirectory covariates.

Usage

1
2
3
4
5
6
7
popRFdemo(project_dir, 
          country="NPL", 
          cores=0, 
          quant=TRUE, 
          ftp=TRUE, 
          verbose=TRUE, 
          log=TRUE, ...)

Arguments

project_dir

Path to the folder to save the outputs.

country

character. ISO of the country (see country codes). Default one is NPL (Nepal)

cores

is a integer. Number of cores to use when executing the function. If set to 0 (max_number_of_cores - 1) will be used based on as many processors as the hardware and RAM allow. Default is cores = 0.

quant

If FALSE then quant will not be calculated

ftp

is logical. TRUE or FALSE: flag indicating whether FTP or HTTPS of WorldPop data hub server will be used. Default is ftp = TRUE.

verbose

is logical. TRUE or FALSE: flag indicating whether to print intermediate output from the function on the console, which might be helpful for model debugging. Default is verbose = TRUE.

log

is logical. TRUE or FALSE: flag indicating whether to print intermediate output from the function on the log.txt file. Default is log = FALSE.

...

Additional arguments:
binc: Numeric. Increase number of blocks sugesting for processing raster file.
boptimise: Logical. Optimize total memory requires to processing raster file by reducing the memory need to 35%.
bsoft: Numeric. If raster can be processed on less then cores it will be foresed to use less number of cores.
nodesize: Minimum size of terminal nodes. Setting this number larger causes smaller trees to be grown (and thus take less time). See randomForest for more details. Default is nodesize = NULL and will be calculated as length(y_data)/1000.
maxnodes Maximum number of terminal nodes trees in the forest can have. If not given, trees are grown to the maximum possible (subject to limits by nodesize). If set larger than maximum possible, a warning is issued. See randomForest for more details. Default is maxnodes = NULL.
ntree Number of variables randomly sampled as candidates at each split. See randomForest for more details. Default is ntree = NULL and ntree will be used popfit$ntree
mtry Number of trees to grow. This should not be set to too small a number, to ensure that every input row gets predicted at least a few times. See randomForest for more details. Default is ntree = NULL and ntree will be used popfit$mtry.

Value

Raster* object of gridded population surfaces.

References

Examples

1
2
3
4
5
6
## Not run: 
popRFdemo(project_dir="/home/user/demo",
          country="NPL", 
          cores=0)

## End(Not run) 

popRF documentation built on July 26, 2021, 9:07 a.m.