Home > other >  Concatenating two different lists
Concatenating two different lists

Time:09-01

I have two lists below.

List1 <- list( c("Ford", "Toyota"), c("Chevy", "Dodge", "Jeep"))

List_2 <- list(c("Fusion", "Corolla"), c("Silverado", "Ram", "Renegade"))

How can I concatenate the characters in these lists to make a new list? Is there a lapply() solution?

The new list should be as follows.

NewList <- list( c("Ford Fusion", "Toyota Corolla"), 
             c("Chevy Silverado", "Dodge Ram", "Jeep Renegade"))

Thanks in advance!

CodePudding user response:

try this: mapply(paste, List1, List_2)

  • Related