| Title: | Extend 'ggplot2' with Layers and Scales for Spatial Uncertainty Visualization |
| Version: | 0.2.0 |
| Description: | Provide specialized 'ggplot2' layers and scales for spatial uncertainty visualization, including bivariate choropleth maps, pixel maps, glyph maps, and exceedance probability maps. |
| Imports: | cli, colorspace, dplyr, grDevices, grid, gtable, purrr, rlang, scales, sf, withr |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Suggests: | ggChernoff, testthat (≥ 3.0.0), vdiffr |
| Config/testthat/edition: | 3 |
| Depends: | ggplot2 (≥ 3.5.0), R (≥ 4.1.0) |
| LazyData: | true |
| URL: | https://github.com/maggiexma/ggincerta |
| BugReports: | https://github.com/maggiexma/ggincerta/issues |
| NeedsCompilation: | no |
| Packaged: | 2026-05-25 04:21:27 UTC; maxueqi |
| Author: | Xueqi Ma [aut, cre, cph],
Emi Tanaka |
| Maintainer: | Xueqi Ma <maggiexma07@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-05-25 04:30:02 UTC |
ggincerta: Extend 'ggplot2' with Layers and Scales for Spatial Uncertainty Visualization
Description
Provide specialized 'ggplot2' layers and scales for spatial uncertainty visualization, including bivariate choropleth maps, pixel maps, glyph maps, and exceedance probability maps.
Author(s)
Maintainer: Xueqi Ma maggiexma07@gmail.com [copyright holder]
Authors:
Emi Tanaka dr.emi.tanaka@gmail.com (ORCID) [thesis advisor]
Other contributors:
Weihao Li llreczx@gmail.com (ORCID) [thesis advisor]
Quan Vu [thesis advisor]
Francis Hui fhui28@gmail.com (ORCID) [thesis advisor]
See Also
Useful links:
Bivariate colour guide
Description
The bivariate colour guide is displayed as a grid, where each cell represents the mapping between a colour and the corresponding bin intervals of the two variables along the guide axes.
Usage
GuideBivariate
guide_bivariate(
theme = NULL,
title = NULL,
order = 0,
position = NULL,
rotated = FALSE,
angle = 45
)
Arguments
theme |
A |
title |
A character string or expression indicating a title of guide.
If |
order |
positive integer less than 99 that specifies the order of this guide among multiple guides. This controls the order in which multiple guides are displayed, not the contents of the guide itself. If 0 (default), the order is determined by a secret algorithm. |
position |
A character string indicating where the legend should be placed relative to the plot panels. One of "top", "right", "bottom", "left", or "inside". |
rotated |
Logical indicating whether the guide should be displayed in a rotated orientation. |
angle |
A numeric value specifying the rotation angle of the guide. |
Format
An object of class GuideBivariate (inherits from GuideLegend, Guide, ggproto, gg) of length 26.
Drop glyph guide
Description
Guide for drop glyph consists of two axes and a sequence of example drop grobs illustrating the mapping between uncertainty and glyph rotation angles.
Usage
GuideGlyph
guide_glyph(
theme = NULL,
title = waiver(),
order = 99,
position = NULL,
direction = "vertical"
)
Arguments
theme |
A |
title |
A character string or expression indicating a title of guide.
If |
order |
positive integer less than 99 that specifies the order of this guide among multiple guides. This controls the order in which multiple guides are displayed, not the contents of the guide itself. If 0 (default), the order is determined by a secret algorithm. |
position |
A character string indicating where the legend should be placed relative to the plot panels. One of "top", "right", "bottom", "left", or "inside". |
direction |
A character string indicating the direction of the guide. One of "horizontal" or "vertical". |
Format
An object of class GuideGlyph (inherits from Guide, ggproto, gg) of length 4.
Details
Rotation angles range from \pi to -\pi, corresponding to the
minimum and maximum uncertainty values respectively.
VSUP guide
Description
This guide is displayed as a fan-shaped legend. Uncertainty levels are arranged along the radial axis, while value groups are arranged along the arc axis. As uncertainty increases towards the centre of the guide, the number of value groups progressively decreases until only a single group remains.
Usage
GuideVSUP
guide_vsup(theme = NULL, title = waiver(), order = 0, position = NULL)
Arguments
theme |
A |
title |
A character string or expression indicating a title of guide.
If |
order |
positive integer less than 99 that specifies the order of this guide among multiple guides. This controls the order in which multiple guides are displayed, not the contents of the guide itself. If 0 (default), the order is determined by a secret algorithm. |
position |
A character string indicating where the legend should be placed relative to the plot panels. One of "top", "right", "bottom", "left", or "inside". |
Format
An object of class GuideVSUP (inherits from GuideLegend, Guide, ggproto, gg) of length 18.
Bivariate colour scale constructor
Description
bivariate_scale() maps binned combinations of two variables to colour
dimensions and their combinations in perceptual colour space, supporting
the construction of bivariate choropleth maps.
Usage
ScaleBivariate
bivariate_scale(
aesthetics,
...,
name = waiver(),
breaks = list(waiver(), waiver()),
labels = list(waiver(), waiver()),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
na.value = NA,
na.translate = TRUE,
drop = FALSE,
guide = waiver(),
colours = c("gold", "red4"),
palette_fun = NULL,
palette_params = list(),
n_breaks = c(4, 4),
bin_method = c("equal", "equal"),
var1_name = NULL,
var2_name = NULL,
super = ScaleBivariate
)
scale_fill_bivariate(
...,
name = waiver(),
var1_name = NULL,
var2_name = NULL,
colours = c("gold", "red4"),
palette_fun = NULL,
palette_params = list(),
n_breaks = c(4, 4),
breaks = list(waiver(), waiver()),
labels = list(waiver(), waiver()),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
bin_method = c("equal", "equal"),
na.value = NA,
aesthetics = "fill",
guide = guide_bivariate()
)
scale_color_bivariate(
...,
name = waiver(),
var1_name = NULL,
var2_name = NULL,
colours = c("gold", "red4"),
palette_fun = NULL,
palette_params = list(),
n_breaks = c(4, 4),
breaks = list(waiver(), waiver()),
labels = list(waiver(), waiver()),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
bin_method = c("equal", "equal"),
na.value = NA,
aesthetics = "colour",
guide = guide_bivariate()
)
scale_colour_bivariate(
...,
name = waiver(),
var1_name = NULL,
var2_name = NULL,
colours = c("gold", "red4"),
palette_fun = NULL,
palette_params = list(),
n_breaks = c(4, 4),
breaks = list(waiver(), waiver()),
labels = list(waiver(), waiver()),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
bin_method = c("equal", "equal"),
na.value = NA,
aesthetics = "colour",
guide = guide_bivariate()
)
Arguments
aesthetics |
The names of the aesthetics that this scale works with. |
... |
Other arguments passed to |
name |
The name of the scale. Used as the axis or legend title. If
|
breaks |
A list of two numeric vectors specifying bin boundaries for
each variable. If |
labels |
A list of two character vectors or labelling functions
used to label the bin boundaries for each variable. If |
limits |
A list of two numeric vectors specifying the range of values to include for each variable. |
transform |
A list of two transformations applied to the variables
before binning. Each element can be a transformation name or a
transformer object accepted by |
na.value |
If |
na.translate |
Unlike continuous scales, discrete scales can easily show
missing values, and do so by default. If you want to remove missing values
from a discrete scale, specify |
drop |
Should unused factor levels be omitted from the scale?
The default, |
guide |
A function used to create a guide or its name. See
|
colours |
A character vector of colours used as key points in the colour
ramp that variables are mapped to. For details on how supplied colours are
used to construct the resulting palette, see |
palette_fun |
A palette function that, when called with |
palette_params |
A list of additional arguments passed to |
n_breaks |
An integer or a length-two vector specifying the number of bins for each variable. The default is 4 for both variables, and unequal numbers of bins are supported. |
bin_method |
A character string or a length-two vector specifying the
method used to bin each variable: |
var1_name, var2_name |
Optional names for |
super |
The super class to use for the constructed scale |
Format
An object of class ScaleBivariate (inherits from ScaleDiscrete, Scale, ggproto, gg) of length 17.
Details
It can be automatically dispatched in aes() using duo() and works
with any ggplot2 geom.
Value
A ScaleBivariate ggproto object.
See Also
ggplot2::Scale for the base ggproto class that all scale objects inherit from.
Examples
# Basic bivariate map
ggplot(nc) +
geom_sf(aes(fill = duo(value, sd)))
# Use an alternative bivariate palette
ggplot(nc) +
geom_sf(aes(fill = duo(value, sd))) +
scale_fill_bivariate(
palette_fun = bivar_fade_palette,
colours = c("#F6E8C3", "orange", "red")
)
# Customize the number of bins
ggplot(nc) +
geom_sf(aes(fill = duo(value, sd))) +
scale_fill_bivariate(n_breaks = c(3, 4))
Value-Suppressing Uncertainty Palette (VSUP) scale
Description
This scale implements Value-Suppressing Uncertainty Palettes (VSUPs), proposed by Correll et al. (2018). The main idea is to suppress colour variation in regions with higher uncertainty, thereby directing visual attention towards more reliable value differences.
Usage
ScaleVSUP
scale_fill_vsup(
name = waiver(),
colours = c("gold", "red4"),
layers = 4,
branch = 2L,
breaks = list(NULL, NULL),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
title_value = "Value",
title_uncertainty = "Uncertainty",
na.value = NA,
na.translate = TRUE,
aesthetics = "fill",
max_light = 0.7,
max_desat = 0.9,
pow_light = 1,
pow_desat = 1,
space = "Lab",
guide = guide_vsup(),
...
)
scale_colour_vsup(
name = waiver(),
colours = c("gold", "red4"),
layers = 4,
branch = 2L,
breaks = list(NULL, NULL),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
title_value = "Value",
title_uncertainty = "Uncertainty",
na.value = NA,
na.translate = TRUE,
aesthetics = "colour",
max_light = 0.7,
max_desat = 0.9,
pow_light = 1,
pow_desat = 1,
space = "Lab",
guide = guide_vsup(),
...
)
Arguments
name |
The name of the scale. Used as the axis or legend title. If
|
colours |
A character vector of colours used as key points in the value
colour scale. See |
layers |
An integer specifying the number of uncertainty levels. |
branch |
An integer specifying the branching factor used to allocate
value bins across uncertainty levels. The maximum number of value bins is
|
breaks |
One of:
|
limits |
One of:
|
transform |
A list of two transformations applied to the variables
before binning. Each element can be a transformation name or a
transformer object accepted by |
title_value, title_uncertainty |
Optional titles for the value and uncertainty dimensions in the guide. |
na.value |
If |
na.translate |
Unlike continuous scales, discrete scales can easily show
missing values, and do so by default. If you want to remove missing values
from a discrete scale, specify |
aesthetics |
The names of the aesthetics that this scale works with. |
max_light |
A numeric value specifying the maximum amount of lightening applied across uncertainty levels. |
max_desat |
A numeric value specifying the maximum amount of desaturation applied across uncertainty levels. |
pow_light, pow_desat |
Numeric values controlling the rate of lightening and desaturation across uncertainty levels. |
space |
A character string specifying the colour space used for colour interpolation. |
guide |
A function used to create a guide or its name. See
|
... |
Other arguments passed to |
Format
An object of class ScaleVSUP (inherits from ScaleDiscrete, Scale, ggproto, gg) of length 8.
See Also
Correll et al. (2018) doi:10.1145/3173574.3174216 for technical details.
Pixel map
Description
geom_sf_pixel() generates a pixel map layer on areal sf data. Each region
is tessellated into small pixels, with pixel colours mapped from values
sampled from a specified distribution.
Usage
StatPixel
geom_sf_pixel(
mapping = NULL,
data = NULL,
n = 60,
distribution = "uniform",
seed = NULL,
pixel_shape = "hex",
flat_topped = FALSE,
show.legend = NA,
inherit.aes = TRUE,
...
)
Arguments
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
n |
integer of length 1 or 2, number of grid cells in x and y direction (columns, rows) |
distribution |
Distribution used to sample pixel values within each
region. Currently supports |
seed |
Integer seed used for reproducible sampling. |
pixel_shape |
Shape of the generated pixels. One of |
flat_topped |
logical; if |
show.legend |
logical. Should this layer be included in the legends?
You can also set this to one of "polygon", "line", and "point" to override the default legend. |
inherit.aes |
If |
... |
Other arguments passed on to
|
Format
An object of class StatPixel (inherits from StatSf, Stat, ggproto, gg) of length 3.
Details
Mappings in geom_sf_pixel() is also supplied with duo_pixel() inside
aes(), which automatically dispatches an scale.
Since sf::st_intersection() is used internally, operating directly on
geographic (s2) sf objects can be slow, especially when a large number of
pixels are generated. Projecting data to a planar coordinate system in
advance is recommended.
Value
A list of ggplot2 layer objects.
Examples
# Transform sf data into a planar crs for faster geometric intersection
nc_flat <- sf::st_transform(nc, sf::st_crs(3857))
# Basic pixel map
ggplot(nc_flat, aes(fill = duo_pixel(value, sd))) +
geom_sf_pixel(n = 40)
# Control pixel shape and resolution
ggplot(nc_flat, aes(fill = duo_pixel(value, sd))) +
geom_sf_pixel(n = 30, pixel_shape = "square")
Colour fading palette
Description
One or more supplied colours construct a value colour scale, then varies perceptual properties such as lightness, saturation, or transparency along the uncertainty dimension.
Usage
bivar_fade_palette(
colours,
n_breaks,
fade = c("lighten", "alpha", "desaturate"),
alpha_range = c(1, 0.3),
max_light = 0.7,
max_desat = 0.9,
space = "Lab"
)
Arguments
colours |
A character vector of colours used as key points in interpolation. |
n_breaks |
An integer or a length-two vector specifying the number of bins for each variable. The default is 4 for both variables, and unequal numbers of bins are supported. |
fade |
A character string specifying the fading method: |
alpha_range |
A numeric vector of length two specifying the
range of transparency values used when |
max_light |
A numeric value specifying the maximum amount of lightening applied across uncertainty levels. |
max_desat |
A numeric value specifying the maximum amount of desaturation applied across uncertainty levels. |
space |
A character string specifying the colour space used for interpolation. |
Colour blending palette
Description
This palette function constructs two colour ramps from white to the supplied endpoint colours, then blends them by additive averaging in grDevices::rgb colour space. The resulting palette contains one colour for each combination of the two binned variables.
Usage
bivar_palette(
colours = NULL,
n_breaks = c(4, 4),
flip = c("none", "vertical", "horizontal", "both")
)
Arguments
colours |
A character vector of two colours used as the endpoints of the two colour ramps. |
n_breaks |
An integer or a length-two vector specifying the number of bins for each variable. The default is 4 for both variables, and unequal numbers of bins are supported. |
flip |
A character string specifying how to flip the palette:
|
Format input and assign the "map" class
Description
duo() and duo_pixel() create paired mapping objects that combine two
variables, record their names, and assign the bivariate/pixel class as
an attribute for use in aesthetic mappings.
Usage
duo(v1, v2)
duo_pixel(estimate, error)
Arguments
v1, v2 |
Input variables for |
estimate, error |
Input variables for |
Value
A list-like object containing pairs of values from the two variables, with attributes storing the variable names and the class.
Examples
value <- nc$value
sd <- nc$sd
res <- duo(value, sd)
res_pixel <- duo_pixel(value, sd)
class(res); class(res_pixel)
attr(res, "vars"); attr(res_pixel, "vars")
Dual map
Description
geom_sf_dualmap() generates a map where each region is represented by two
visual components: the surrounding area is mapped using fill, and the
central glyph is mapped using colour.
Usage
geom_sf_dualmap(
mapping = NULL,
data = NULL,
...,
shape = "circle",
max_angle = NULL,
size = 1,
point_fun = sf::st_point_on_surface,
border_colour = NA,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
angle_guide = TRUE,
angle_name = waiver(),
angle_order = 2,
fill_scale = NULL
)
Arguments
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
... |
Other arguments passed on to
|
shape |
Glyph shape. One of |
max_angle |
Maximum value of the |
size |
A positive numeric scaling factor controlling glyph size. |
point_fun |
Function used to calculate the representative point for each
region. The default is usually |
border_colour |
Colour used for glyph borders. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
You can also set this to one of "polygon", "line", and "point" to override the default legend. |
inherit.aes |
If |
angle_guide |
Logical indicating whether to display a guide for the
|
angle_name |
Title used for the angle guide. |
angle_order |
Order of the angle guide relative to other guides. |
fill_scale |
Optional fill scale for the surrounding area. If |
Details
This allows two variables, such as value and uncertainty, to be shown within the same geographic region using separate scales.
Value
A list of layers generated by ggplot2::geom_sf() and geom_sf_glyph().
Examples
# Dual map with separate fill and colour mappings
ggplot(nc) +
geom_sf_dualmap(aes(fill = sd, colour = value))
# Dual map using a bivariate colour scale for the central glyph
ggplot(nc) +
geom_sf_dualmap(aes(fill = duo(value, sd), colour = sd_log2))
Glyph map
Description
geom_sf_glyph() generates a glyph map sf layer. A glyph map is a
centroid-based map, where each region is represented by a chosen glyph.
Usage
geom_sf_glyph(
mapping = NULL,
data = NULL,
...,
shape = "circle",
max_angle = NULL,
size = 1,
point_fun = sf::st_point_on_surface,
border_colour = NA,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
angle_guide = TRUE,
angle_name = waiver(),
angle_order = 99
)
Arguments
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
... |
Other arguments passed on to
|
shape |
Glyph shape. One of |
max_angle |
Maximum value of the |
size |
A positive numeric scaling factor controlling glyph size. |
point_fun |
Function used to calculate the representative point for each
region. The default is usually |
border_colour |
Colour used for glyph borders. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
You can also set this to one of "polygon", "line", and "point" to override the default legend. |
inherit.aes |
If |
angle_guide |
Logical indicating whether to display a guide for the
|
angle_name |
Title used for the angle guide. |
angle_order |
Order of the angle guide relative to other guides. |
Details
Regular shape glyphs can be treated as ordinary point-like symbols and used
together with bivariate_scale(). Drop-shaped glyphs use rotation angle to
represent uncertainty. Chernoff glyphs are adapted from the ggChernoff
package and work with the smile aesthetic.
Value
A list of ggplot2 layer objects.
Examples
# Regular glyph map
ggplot(nc) +
geom_sf_glyph(aes(colour = value), shape = "hex")
# Rotated drop glyph map
ggplot(nc) +
geom_sf_glyph(
aes(colour = value, angle = sd),
shape = "drop"
)
# Chernoff face glyph map
if (requireNamespace("ggChernoff", quietly = TRUE)) {
ggplot(nc) +
geom_sf_glyph(
aes(colour = value, smile = sd),
shape = "chernoff"
)
}
Create your own bivariate colour scale
Description
These scales allow users to provide all colours used for the combinations of two variables in a bivariate colour scale.
Usage
manual_bivariate_scale(
aesthetics,
...,
values,
name = waiver(),
breaks = list(waiver(), waiver()),
labels = list(waiver(), waiver()),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
na.value = NA,
na.translate = TRUE,
drop = FALSE,
guide = guide_bivariate(),
n_breaks = c(4, 4),
bin_method = c("equal", "equal"),
var1_name = NULL,
var2_name = NULL,
super = ScaleBivariate
)
scale_fill_bivariate_manual(
...,
values,
name = waiver(),
var1_name = NULL,
var2_name = NULL,
n_breaks = c(4, 4),
breaks = list(waiver(), waiver()),
labels = list(waiver(), waiver()),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
bin_method = c("equal", "equal"),
na.value = NA,
na.translate = TRUE,
aesthetics = "fill",
guide = guide_bivariate()
)
scale_colour_bivariate_manual(
...,
values,
name = waiver(),
var1_name = NULL,
var2_name = NULL,
n_breaks = c(4, 4),
breaks = list(waiver(), waiver()),
labels = list(waiver(), waiver()),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
bin_method = c("equal", "equal"),
na.value = NA,
na.translate = TRUE,
aesthetics = "colour",
guide = guide_bivariate()
)
scale_color_bivariate_manual(
...,
values,
name = waiver(),
var1_name = NULL,
var2_name = NULL,
n_breaks = c(4, 4),
breaks = list(waiver(), waiver()),
labels = list(waiver(), waiver()),
limits = list(NULL, NULL),
transform = list("identity", "identity"),
bin_method = c("equal", "equal"),
na.value = NA,
na.translate = TRUE,
aesthetics = "colour",
guide = guide_bivariate()
)
Arguments
aesthetics |
The names of the aesthetics that this scale works with. |
... |
Other arguments passed to |
values |
A character vector of colours. The length should be at least
the product of |
name |
The name of the scale. Used as the axis or legend title. If
|
breaks |
A list of two numeric vectors specifying bin boundaries for
each variable. If |
labels |
A list of two character vectors or labelling functions
used to label the bin boundaries for each variable. If |
limits |
A list of two numeric vectors specifying the range of values to include for each variable. |
transform |
A list of two transformations applied to the variables
before binning. Each element can be a transformation name or a
transformer object accepted by |
na.value |
If |
na.translate |
Unlike continuous scales, discrete scales can easily show
missing values, and do so by default. If you want to remove missing values
from a discrete scale, specify |
drop |
Should unused factor levels be omitted from the scale?
The default, |
guide |
A function used to create a guide or its name. See
|
n_breaks |
An integer or a length-two vector specifying the number of bins for each variable. The default is 4 for both variables, and unequal numbers of bins are supported. |
bin_method |
A character string or a length-two vector specifying the
method used to bin each variable: |
var1_name, var2_name |
Optional names for |
super |
The super class to use for the constructed scale |
Examples
ggplot(nc, aes(fill = duo(value, sd))) +
geom_sf() +
scale_fill_bivariate_manual(
values = c(
"#F7F4F9", "#D4B9DA", "#C994C7", "#980043",
"#E0ECF4", "#BFD3E6", "#9EBCDA", "#8856A7",
"#D0D1E6", "#A6BDDB", "#74A9CF", "#2B8CBE",
"#B8E186", "#7FBC41", "#4D9221", "#276419"
)
)
North Carolina SIDS data
Description
The dataset nc is derived from the North Carolina shapefile (nc.shp)
included in the sf package. Two random variables, value and sd,
have been added for demonstration purposes.
Further details about the original data can be found in the spdep package vignette.
Usage
nc
Format
A sf object.
Examples
head(nc)
plot(sf::st_geometry(nc))
Pixel fill scale
Description
Pixel fill scale
Usage
scale_fill_pixel(
type = "seq",
palette = "Oranges",
direction = 1,
name = waiver(),
...
)
Arguments
type |
One of "seq" (sequential), "div" (diverging) or "qual" (qualitative) |
palette |
A palette function that when called with a numeric vector with
values between 0 and 1 returns the corresponding output values
(e.g., |
direction |
Sets the order of colours in the scale. If 1, the default,
colours are as output by |
name |
The name of the scale. Used as the axis or legend title. If
|
... |
Additional arguments passed to |
Value-Suppressing Uncertainty Palettes
Description
vsup_palette() handles colour generation for VSUP scales. It modifies the
supplied base colours by progressively desaturating and lightening them as
uncertainty increases.
Usage
vsup_palette(
leaf_info,
colours,
layers = 4,
branch = 2,
max_light = 0.7,
max_desat = 0.9,
pow_light = 1,
pow_desat = 1,
space = "Lab"
)
Arguments
leaf_info |
A data frame describing the VSUP bin structure, produced by
|
colours |
A character vector of colours used as key points for interpolating the value colour scale at the lowest uncertainty level. |
layers |
An integer specifying the number of uncertainty levels. |
branch |
An integer specifying the branching factor used to allocate
value bins across uncertainty levels. The maximum number of value bins is
|
max_light |
A numeric value specifying the maximum amount of lightening applied across uncertainty levels. |
max_desat |
A numeric value specifying the maximum amount of desaturation applied across uncertainty levels. |
pow_light, pow_desat |
Numeric values controlling the rate of lightening and desaturation across uncertainty levels. |
space |
A character string specifying the colour space used for colour interpolation. |
Tree quantization for VSUPs
Description
Quantize value and uncertainty variables into a hierarchical VSUP tree.
Usage
vsup_quantize(
v,
u,
layers = 4,
branch = 2L,
breaks = list(NULL, NULL),
limits = list(NULL, NULL),
transform = list("identity", "identity")
)
Arguments
v |
Numeric vector of value variable. |
u |
Numeric vector of uncertainty variable. |
layers |
An integer specifying the number of uncertainty levels. |
branch |
An integer specifying the branching factor used to allocate
value bins across uncertainty levels. The maximum number of value bins is
|
breaks |
One of:
|
limits |
One of:
|
transform |
A list of two transformations applied to the variables
before binning. Each element can be a transformation name or a
transformer object accepted by |
Value
A list containing quantized leaf ids and break information.