This function is called by the cov_nightlight module and downloads annual data on night time illumination from Worldpop
cov_nightlight(shape, country_code, year, async = FALSE)
sf. sf object containing the area of interest
vector. ISO3 code of the country or countries.
numeric. Year for which to download the data. Limited to 2015-2023
Whether or not the function is being used asynchronously. When
TRUE
the returned object is a wrapped SpatRaster.
a SpatRaster object when async
is FALSE
or a PackedSpatRaster
when async
is TRUE
.
if (FALSE) { # \dontrun{
df_path <- system.file("extdata", "lie.csv", package = "disagapp")
df <- read.csv(df_path)
lie_shape <- resp_download(df, "area", "response", "LIE", "ADM1")
raster <- cov_nightlight(lie_shape, "LIE", 2022)
} # }