Write a R program to create a list of elements using vectors, matrices and a functions. Print the content of the list.
l = list( c(1, 2, 2, 5, 7, 12), month.abb, matrix(c(3, -8, 1, -3), nrow = 2), asin ) print("Content of the list:") print(l)
Sample Output:
[1] "Content of the list:" [[1]] [1] 1 2 2 5 7 12 [[2]] [1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec" [[3]] [,1] [,2] [1,] 3 1 [2,] -8 -3 [[4]] function (x) .Primitive("asin")
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:
[1] "Content of the list:" [[1]] [1] 1 2 2 5 7 12 [[2]] [1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec" [[3]] [,1] [,2] [1,] 3 1 [2,] -8 -3 [[4]] function (x) .Primitive("asin")need an explanation for this answer? contact us directly to get an explanation for this answer