A wk_trans implementation that replaces coordinate values using a vector of pre-calculated coordinates. This is used to perform generic transforms using R functions and system calls that are impossible or impractical to implement at the C level.

wk_trans_explicit(value, use_z = NA, use_m = NA)

Arguments

value

An xy(), xyz(), xym(), or xyzm() of coordinates used to replace values in the input. Use NA to keep the existing value.

use_z, use_m

Used to declare the output type. Use TRUE to ensure the output has that dimension, FALSE to ensure it does not, and NA to leave the dimension unchanged.

See also

wk_coords() which has a replacement version "wk_coords<-"

Examples

trans <- wk_trans_explicit(xy(1:5, 1:5))
wk_transform(rep(xy(0, 0), 5), trans)
#> <wk_xy[5]>
#> [1] (1 1) (2 2) (3 3) (4 4) (5 5)