Given two named vectors/lists x and y and a list of names
this function replaces all entries of x with the matching entries in y.
insert(x, y, which)
| x | [ |
|---|---|
| y | [ |
| which | [ |
Either a vector or a list depending on the type of x and y.
#> $a #> [1] 100 #> #> $b #> [1] "hello" #> #> $c #> [1] "world" #>insert(y, x)#> $b #> [1] "a" "b" "c" #> #> $c #> [1] "world" #> #> $a #> [1] 100 #>insert(x, y, which = "b")#> $a #> [1] 100 #> #> $b #> [1] "hello" #>