list_shuffle {quickcode}R Documentation

Shuffle a list object just like shuffle in PHP

Description

Shorthand to shuffle a list and save

Usage

list_shuffle(., seed = NULL)

Arguments

.

list to shuffle

seed

apply seed if indicated for reproducibility

Value

shuffled list of items store to the list name

Examples

list001 <- list("a" = 1:5,
           "b" = letters[1:5],
           c = LETTERS[1:10],
           "2" = number(5,5),
           "e" = randString(5,5))
list001 #show initial list

#illustrate basic functionality
list_shuffle(list001)
list001 #shuffle and resaved to variable

list.f2<-list001
list_shuffle(list.f2)
list.f2 #first output

list.f2<-list001
list_shuffle(list.f2)
list.f2 # different output from first output top

list.f2<-list001
list_shuffle(list.f2,seed = 344L)
list.f2 #second output

list.f2<-list001
list_shuffle(list.f2,seed = 344L)
list.f2 #the same output as second output top


[Package quickcode version 0.9.1 Index]