ll2a: Convert list of lists of numbers to array

Description Usage Arguments Value Examples

View source: R/misc.R

Description

Converts lists of lists of numbers to a numeric array fast this has been optimised against other possible implementations and been found to the the fastest

Usage

1
ll2a(inputList)

Arguments

inputList

a list of lists of numbers

Value

an array where the top-level lists are rows and low-level lists are columns

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mylist <- list()
mylist_ <- list()
for(i in 1:10) {
  for(j in 1:100) {
    mylist[[j]] <- i*j
  }
  mylist_[[i]] <- mylist
}
str(mylist_)
r3 <- ll2a.3(mylist_)

barkasn/nbHelpers documentation built on Oct. 10, 2020, 9:46 p.m.