map_absolute: Manually offset and scale the first 2 columns of a matrix or...

View source: R/0_util.r

map_absoluteR Documentation

Manually offset and scale the first 2 columns of a matrix or data.frame.

Description

A manual variant of map_relative(). Can be used as the axes argument to manually set the size and locations of the axes.

Usage

map_absolute(x, offset = c(0, 0), scale = c(1, 1))

Arguments

x

Numeric data object with 2 columns to scale and offset. Defaults to NULL, passing arguments to scale_axes for use internally.

offset

2 Numeric values to offset/pan the first 2 dimensions of x.

scale

2 Numeric values to scale/zoom to the first 2 dimensions of x.

Value

Scaled and offset x.

See Also

scale_axes for preset choices.

Other linear mapping functions: map_relative()

Examples

bas <- tourr::basis_random(4, 2)

map_absolute(bas, offset = c(-2, 0), scale = c(2/3, 2/3))

spinifex documentation built on March 31, 2022, 9:06 a.m.