View source: R/lfcCatDrought.R
catdrought_get_raster | R Documentation |
catdrought_get_raster
is a wrapper for the
$get_raster
method of lfcCatDrought
objects.
See also catdrought
.
catdrought_get_raster(
object,
date,
spatial = "stars",
rast_column = "rast",
bands = TRUE,
clip = NULL
)
object |
|
date |
character with the date of the raster to retrieve, i.e "2020-04-25" |
spatial |
character vector of length 1 indicating the type of raster object to return, "raster" or "stars", the default. |
Connection to database can be slow. Rasters retrieved from the db
are stored in a temporary cache inside the lfcCatDrought object created by
catdrought
, making subsequent calls to the same table are
faster. But, be warned that in-memory rasters can use a lot of memory!
A raster object: RasterBrick
if spatial is raster
,
stars
if spatial is stars
. See
https://r-spatial.github.io/stars/index.html for details about stars
objects and raster
for details about raster objects.
Other catdrought functions:
catdrought_describe_var()
,
catdrought_get_current_time_series()
,
catdrought()
if (interactive()) {
catdroughtdb <- catdrought()
# raster
catdrougth_20200425_smoothed <-
catdrought_get_raster(catdroughtdb, '2020-04-25', 'smoothed', 'raster')
# stars
catdrougth_20200425_smoothed_stars <-
catdrought_get_raster(catdroughtdb, '2020-04-25', 'smoothed', 'stars')
# we can use pipes
catdroughtdb |>
catdrought_get_raster('2020-04-25', 'smoothed', 'raster')
# catdroughtdb is an R6 object, so the previous examples are the same as:
catdroughtdb$get_raster('2020-04-25', 'smoothed', 'raster')
catdroughtdb$get_raster('2020-04-25', 'smoothed', 'stars')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.