Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

insert

Insert elements from one list/vector into another list/vector.


Description

Inserts elements from xs2 into xs1 by name, overwriting elements of equal names.

Usage

insert(xs1, xs2, elements)

Arguments

xs1

[list]
First list/vector.

xs2

[list]
Second vector/list. Must be fully and uniquely named.

elements

[character]
Elements from xs2 to insert into xs1. Default is all.

Value

x1 with replaced elements from x2.

Examples

xs1 = list(a = 1, b = 2)
xs2 = list(b = 1, c = 4)
insert(xs1, xs2)
insert(xs1, xs2, elements = "c")

BBmisc

Miscellaneous Helper Functions for B. Bischl

v1.11
BSD_2_clause + file LICENSE
Authors
Bernd Bischl [aut, cre], Michel Lang [aut], Jakob Bossek [aut], Daniel Horn [aut], Jakob Richter [aut], Dirk Surmann [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.