Learn R Programming

shinyscholar (version 0.2.5)

select_query: Load FAPAR data from NASA

Description

Called by the select_query module in the example app and loads an FAPAR raster for the selected area via the Earthdata API.

Usage

select_query(poly, date, token, logger = NULL)

Value

a SpatRaster object

Arguments

poly

matrix. Coordinates of area to load

date

character. Date of image to load in YYYY-MM-DD format.

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 get_nasa_token()

logger

Stores all notification messages to be displayed in the Log Window. Insert the logger reactive list here for running in shiny, otherwise leave the default NULL

Author

Simon Smart simon.smart@cantab.net

Examples

Run this code
if (FALSE) {
 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 = "", password = "")
   ras <- select_query(poly, date, token)
 } else {
   message('reinstall with install.packages("shinyscholar", dependencies = TRUE)
   to run this example')
 }
 }

Run the code above in your browser using DataLab