View source: R/select_async_f.R
select_async | R Documentation |
Called by the select_async module in the example app and loads an FAPAR raster for the selected area via the Earthdata API. This function is identical to select_query but can be run asynchronously
select_async(poly, date, token, async = FALSE)
poly |
matrix. Coordinates of area to load |
date |
character. Date of image to load in |
token |
character. NASA Earthdata API token.
Click here
to register and then
follow these instructions
to obtain one. Alternatively supply your username and password to
|
async |
logical. Whether the function is being run asynchronously |
A list containing:
raster |
a SpatRaster object when |
message |
Information on the number of missing pixels |
Simon Smart simon.smart@cantab.net
## Not run:
if (check_suggests(example = TRUE)) {
poly <- matrix(c(0.5, 0.5, 1, 1, 0.5, 52, 52.5, 52.5, 52, 52), ncol = 2)
colnames(poly) <- c("longitude", "latitude")
date <- "2023-06-20"
token <- get_nasa_token(username = "<username>", password = "<password>")
ras <- select_async(poly, date, token)
} else {
message('reinstall with install.packages("shinyscholar", dependencies = TRUE)
to run this example')
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.