Skip to contents

Get or set existing variable mappings.

Usage

mapped_var(x)

mapped_var(x, keep = TRUE) <- value

Arguments

x

An intensity object.

keep

Logical. Do we keep any previous mapped variables that are not redifined in the mapping object?

value

A mapping object.

Value

mapped_var returns the list of current mapped names of the object x.

See also

Examples

my_data <- count(aphids)
my_data
#> # A mapped object: count class
#> # dim: 2 space, 0 time, 1 obs
#>   [x] [y]   .  . [i]
#>     x   y  xm ym   i
#> 1   1   1   0  0   0
#> 2   2   1  30  0   0
#> 3   3   1  60  0   3
#> 4   4   1  90  0   7
#> 5   5   1 120  0   9
#> 6   6   1 150  0   1
#> # ... with 57 more records (rows)
mapped_var(my_data)
#> * i -> i
#> * x -> x
#> * y -> y
mapped_var(my_data) <- mapping(x = X, y = Y)
mapped_var(my_data)
#> * i -> i
#> * x -> X
#> * y -> Y
mapped_var(my_data) <- mapping(x = x, r = r, keep = FALSE)
mapped_var(my_data)
#> * i -> i
#> * y -> Y
#> * keep -> FALSE
#> * r -> r
#> * x -> x