Convert an atomic vector of users into a list of atomic vectors
chunk_users(x, n = 50) chunk_users_data(x, n = 50)
x | Input vector of users. Duplicates and missing values will be removed |
---|---|
n | Number of users per chunk (users returned in each element of output) |
chunk_users: returns a list containing character vectors
chunk_users_data: returns a list containing data frames
## this generates a vector of user-ID like values users <- replicate(1000, paste(sample(0:9, 14, replace = TRUE), collapse = "")) ## break users into 100-user chunks chunky <- chunk_users(users, n = 100) ## preview returned object str(chunky, 1)#> List of 10 #> $ 1 : chr [1:100] "64535844716441" "53128564585941" "03750512081470" "29216925390655" ... #> $ 2 : chr [1:100] "06588468983506" "57967309064013" "86968632617983" "76826207331464" ... #> $ 3 : chr [1:100] "45574744729766" "92340306290797" "09043922131374" "34933059692503" ... #> $ 4 : chr [1:100] "98601340122455" "11613377289433" "10115528664675" "77798269368947" ... #> $ 5 : chr [1:100] "29614240934078" "52720505943003" "92472231674999" "82267010612506" ... #> $ 6 : chr [1:100] "95599325636021" "45453350949018" "14049189821589" "63900385623940" ... #> $ 7 : chr [1:100] "09264578036016" "98818264722188" "31056028130515" "22703306277501" ... #> $ 8 : chr [1:100] "09476457530512" "06256710404310" "31969390011629" "18487862262344" ... #> $ 9 : chr [1:100] "49212413256107" "62582948719336" "58711367016100" "90442040141661" ... #> $ 10: chr [1:100] "77764853520978" "42526509963091" "90704664817619" "45479891945807" ...