Q:

Write a R program to merge two given lists into one list

0

Write a R program to merge two given lists into one list.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

n1 = list(1,2,3)
c1 = list("Red", "Green", "Black")
print("Original lists:")
print(n1)
print(c1)
print("Merge the said lists:")
mlist =  c(n1, c1)
print("New merged list:")
print(mlist)

Sample Output:

[1] "Original lists:"
[[1]]
[1] 1

[[2]]
[1] 2

[[3]]
[1] 3

[[1]]
[1] "Red"

[[2]]
[1] "Green"

[[3]]
[1] "Black"

[1] "Merge the said lists:"
[1] "New merged list:"
[[1]]
[1] 1

[[2]]
[1] 2

[[3]]
[1] 3

[[4]]
[1] "Red"

[[5]]
[1] "Green"

[[6]]
[1] "Black"

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now