Learn R Programming

mapview (version 1.1.0)

cubeView: View a RasterStack or RasterBrick as 3-dimensional data cube.

Description

Create a 3D data cube from a RasterStack or RasterBrick. The cube can be freely rotated so that Hovmoller views of x - z and y - z are possible.

Usage

cubeView(x, at, col.regions = mapviewGetOption("raster.palette"))

Arguments

x
a RasterStack or RasterBrick
at
the breakpoints used for the visualisation. See levelplot for details.
col.regions
color (palette).See levelplot for details.

Details

The visible layers are alterable by keys: x-axis: LEFT / RIGHT arrow key y-axis: DOWN / UP arrow key z-axis: PAGE_DOWN / PAGE_UP key

Note: Because of key focus issues key-press-events are not always recognised within RStudio at Windows. In this case open the view in a web-browser (RStudio button: "show in new window").

Press and hold left mouse-button to rotate the cube. Press and hold right mouse-button to move the cube. Spin mouse-wheel or press and hold middle mouse-button and move mouse down/up to zoom the cube.

Examples

Run this code
## Not run: 
# library(raster)
# 
# kili_data <- system.file("extdata", "kiliNDVI.tif", package = "mapview")
# kiliNDVI <- stack(kili_data)
# 
# cubeView(kiliNDVI)
# 
# library(RColorBrewer)
# clr <- colorRampPalette(brewer.pal(9, "BrBG"))
# cubeView(kiliNDVI, at = seq(-0.15, 0.95, 0.1), col.regions = clr)
# ## End(Not run)

Run the code above in your browser using DataLab