Skip to contents

consign pipe allows destructing data into multiple variables at once. Internally rlang::set_names is used to name the RHS elements to current scope.

Usage

vars %<-% data

Arguments

vars

[R names] Valid R names separated by colon.

data

[object] R object of the same length as the number of vars names.

Value

Nothing. Assigns LHS names to current scope.

See also

Other result assemblers: %$>%(), %->%(), %to%(), conserve(), control()

Examples

val1 : val_2 : someval %<-% c(2, 4, 9)
c(val1, val_2, someval)
#> [1] 2 4 9

x:y:z %<-% list(c(4,5,12), TRUE, list(a=5,b=9))
x; y; z
#> [1]  4  5 12
#> [1] TRUE
#> $a
#> [1] 5
#> 
#> $b
#> [1] 9
#>