Select Random Element from List in R (Example) | Draw Item Randomly | sample() & length() Functions

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

my_list <- list("XX", # Create example list
6:3,
letters[3:5])
my_list # Print example list

my_list[[sample(1:length(my_list), 1)]] # Pick one list element randomly

Follow me on Social Media:
Рекомендации по теме
Комментарии
Автор

Hi Bro, Is data.frame and data.table uses same functions ? Can you make videos related to data.tables

jesimafirthose