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

Description Usage Arguments Details Author(s) Examples

View source: R/cubeView.R

Description

Creates a 3D data cube view of a RasterStack/Brick. Slices through each dimension (x/y/z) are mapped to the visible sides of the cube. The cube can be freely rotated. Zooming and panning can be used to focus on different areas of the cube.

See Details for information on how to control the location of the slices and all other available keyborad and mouse guestures to control the cube.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
cubeview(x, ...)

## S3 method for class 'character'
cubeview(x, at, col.regions = viridisLite::inferno,
  na.color = "#BEBEBE", legend = TRUE, ...)

## S3 method for class 'stars'
cubeview(x, at, col.regions = viridisLite::inferno,
  na.color = "#BEBEBE", legend = TRUE, ...)

## S3 method for class 'Raster'
cubeview(x, at, col.regions = viridisLite::inferno,
  na.color = "#BEBEBE", legend = TRUE, ...)

cubeView(x, ...)

Arguments

x

a file name, stars object, RasterStack or RasterBrick

...

additional arguments passed on to read_stars.

at

the breakpoints used for the visualisation. See levelplot for details.

col.regions

either a palette function or a vector of colors to be used for palette generation.

na.color

color for missing values.

legend

logical. Whether to plot a legend.

Details

The location of the slices can be controlled by keys:
x-axis: LEFT / RIGHT arrow key
y-axis: DOWN / UP arrow key
z-axis: PAGE_DOWN / PAGE_UP key

Other controls:
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.
Press space bar to show/hide slice position guides.

Note:
In RStudio cubeView may show a blank viewer window. In this case open the view in a web-browser (RStudio button at viewer: "show in new window").

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

Author(s)

Stephan Woellauer and Tim Appelhans

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
if (interactive()) {
  library(raster)
  library(stars)

  ## directly from file
  kili_data <- system.file("extdata", "kiliNDVI.tif", package = "cubeview")
  cubeview(kili_data)

  ## stars object
  kili_strs = read_stars(kili_data)
  cubeview(kili_strs)

  ## rsater stack (also works with brick)
  kili_rstr <- stack(kili_data)
  cubeview(kili_rstr)

  ## use different color palette and set breaks
  clr <- viridisLite::viridis
  cubeview(kili_data, at = seq(-0.15, 0.95, 0.1), col.regions = clr)
}

cubeview documentation built on Sept. 24, 2019, 9:05 a.m.