This function allows users to quickly view a previously created get_*() object.
viz(
data,
scale = 250,
band = NULL,
palette = "RdBu",
n_pal = 6,
reverse = FALSE,
min = NULL,
max = NULL,
gamma = NULL,
opacity = NULL,
user_shape = NULL,
...
)
A previously created get_* object
A numeric
value indicating scale in meters. 250 (default)
A character
indicating what bands/type to use when you have more than one. Can select more than one, e.g. c('Red', 'Green', 'Blue').
character
color palette using colorBrewer format, e.g. "RdBu" (default), "RdYlGn", etc.
numeric
indicating levels of colors in palette. 6 (default).
logical
TRUE/FALSE whether to reverse palette or not, FALSE (default).
numeric
indicating lowest value for viewing.
numeric
indicating highest value for viewing.
numeric
gamma correction factor.
numeric
transparent display value.
A sf object to use as 'aoi/geom' for an 'ee.image.Image'.
additional arguments for mapview.
A leaflet map.
This function uses a scale argument which is used to generate a min and max value for viewing. Because this uses getInfo(), it can take a while depending on the scale. Since this is used for viewing, I would suggest to go bigger on the scale. If a user selects more than one band, the 'up-to' three bands will be overlayed like earth engine. When visualizing a get_diff object, black is towards 0, red is negative (-) and green/blue is positive (+).
if (FALSE) {
# Load Libraries
library(rgee)
rgee::ee_intialize()
library(exploreRGEE)
# Bring in data
huc <- exploreRGEE::huc
ld8 <- get_landsat(huc, method = 'ld8', startDate = '2014-01-01',
endDate = '2018-12-31', c.low = 6, c.high = 11)
ld8 %>% viz(scale = 30, band = 'NDVI', palette = 'RdYlGn')
# or without scale, when min and max are used scale is irrelevant.
ld8 %>% viz(min = 0, max = 1, band = 'NDVI', palette = 'RdYlGn')
}