rbind_by_list_pos | R Documentation |
This function takes a list of lists of data.table
s (or anything that data.table::rbind
accepts, like data.frame
s), and then row-binds them by position or name. For example, if passed list(list(first=A,second=B),list(first=C,second=D))
, you would get back list(first=rbind(A,C),second=rbind(B,D))
.
rbind_by_list_pos(dtl, ignore_names = FALSE)
dtl |
List of lists of |
ignore_names |
If the list is named, match objects across lists only by their position in the list and not by their names. |
list_of_lists <- list( list(data.frame(a = 1), data.frame(a = 2), data.frame(a = 3)), list(data.frame(a = 4), data.frame(a = 5), data.frame(a = 6)) ) rbind_by_list_pos(list_of_lists) list_of_named_lists <- list( list(A = data.frame(a = 1), B = data.frame(a = 2), C = data.frame(a = 3)), list(C = data.frame(a = 4), A = data.frame(a = 5), B = data.frame(a = 6)) ) rbind_by_list_pos(list_of_named_lis)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.