You can use lapply
with c
and unlist
:
lapply(x, function(i) c(i, unlist(y[i], use.names = FALSE)))
#$a
#[1] "c" "d" "e" "10" "11" "12" "20" "21" "22"
#
#$b
#[1] "f" "g" "h" "40" "41" "42" "50" "51" "52"
Data:
x <- list(a = c("c", "d", "e"), b = c("f", "g", "h"))
y <- list(c = 10:12, d = 20:22, f = 40:42, g = 50:52)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…