Learn R Programming

scales (version 1.3.0)

new_transform: Create a new transformation object

Description

A transformation encapsulates a transformation and its inverse, as well as the information needed to create pleasing breaks and labels. The breaks() function is applied on the un-transformed range of the data, and the format() function takes the output of the breaks() function and returns well-formatted labels. Transformations may also include the derivatives of the transformation and its inverse, but are not required to.

Usage

new_transform(
  name,
  transform,
  inverse,
  d_transform = NULL,
  d_inverse = NULL,
  breaks = extended_breaks(),
  minor_breaks = regular_minor_breaks(),
  format = format_format(),
  domain = c(-Inf, Inf)
)

trans_new( name, transform, inverse, d_transform = NULL, d_inverse = NULL, breaks = extended_breaks(), minor_breaks = regular_minor_breaks(), format = format_format(), domain = c(-Inf, Inf) )

is.transform(x)

is.trans(x)

as.transform(x, arg = deparse(substitute(x)))

as.trans(x, arg = deparse(substitute(x)))

Arguments

name

transformation name

transform

function, or name of function, that performs the transformation

inverse

function, or name of function, that performs the inverse of the transformation

d_transform

Optional function, or name of function, that gives the derivative of the transformation. May be NULL.

d_inverse

Optional function, or name of function, that gives the derivative of the inverse of the transformation. May be NULL.

breaks

default breaks function for this transformation. The breaks function is applied to the un-transformed data.

minor_breaks

default minor breaks function for this transformation.

format

default format for this transformation. The format is applied to breaks generated on the un-transformed data.

domain

the allowed range of the data to be transformed. The function in the transform argument is expected to be able to transform the domain argument.

See Also

scales:::seealso_transform()