Create Matrix of Lists in R (Example) | Merge Multiple List Objects | matrix() & list() Functions

preview_player
Показать описание
R code of this video:

my_list1 <- list(1, 2, 3) # Create first list
my_list1 # Print first list

my_list2 <- list("a", "b", "c", "d") # Create second list
my_list2 # Print second list

my_list3 <- list(1, "xxx", 1:3) # Create third list
my_list3 # Print third list

my_list4 <- list(1:3, 2:5) # Create fourth list
my_list4 # Print fourth list

my_mat <- matrix(list(my_list1, # Create matrix of lists
my_list2,
my_list3,
my_list4),
ncol = 2)
my_mat # Print matrix of lists

Follow me on Social Media:

Рекомендации по теме
Комментарии
Автор

How can I change the character values in a dataframe to numbers?!

vahidkia
visit shbcf.ru