R/cov_nightlight_f.R
cov_nightlight.Rd
This function is called by the cov_nightlight module and downloads annual
data on night time illumination from NASA (product ID VNP46A4) using the
blackmarbler package. You must obtain and a token from NASA to use this
function and set an environmental variable called NASA_bearer
to contain it.
It returns a SpatRaster for the selected area and year.
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{
raster <- cov_nightlight("LIE", 2022)
} # }