Write a R program to merge two given lists into one list.
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"
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer