# [R] list concatenation

Georg Otto gwo at well.ox.ac.uk
Tue Jan 11 16:44:46 CET 2011

```Dear R gurus,

first let me apologize for a question that might hve been answered
before. I was not able to find the solution yet. I want to concatenate
two lists of lists at their lowest level.

Suppose I have two lists of lists:

list.1 <- list("I"=list("A"=c("a", "b", "c"), "B"=c("d", "e", "f")),

"II"=list("A"=c("g", "h", "i"), "B"=c("j", "k", "l")))

list.2 <- list("I"=list("A"=c("A", "B", "C"), "B"=c("D", "E", "F")),

"II"=list("A"=c("G", "H", "I"), "B"=c("J", "K", "L")))

> list.1
\$I
\$I\$A
 "a" "b" "c"

\$I\$B
 "d" "e" "f"

\$II
\$II\$A
 "g" "h" "i"

\$II\$B
 "j" "k" "l"

> list.2
\$I
\$I\$A
 "A" "B" "C"

\$I\$B
 "D" "E" "F"

\$II
\$II\$A
 "G" "H" "I"

\$II\$B
 "J" "K" "L"

Now I want to concatenate list elements of the lowest levels, so the
result looks like this:

\$I
\$I\$A
 "a" "b" "c" "A" "B" "C"

\$I\$B
 "d" "e" "f" "D" "E" "F"

\$II
\$II\$A
 "g" "h" "i" "G" "H" "I"

\$II\$B
 "j" "k" "l" "J" "K" "L"

Has anybody a good solution for that?

Best,

Georg

```