Skip to contents

We expect the same representation as in serial-reaction-time-mouse: Each inner array represents a single row. The entries in the inner arrays represent the columns.

Usage

list2_to_matrix(x, byrow = T)

Arguments

x

List of lists, expecting all inner-lists of the same length

byrow

logical. If TRUE (the default) the matrix is filled by rows, otherwise the matrix is filled by columns.

Value

Matrix

Examples

l <- list(list(1:3), list(4:6))
list2_to_matrix(l)
#>      [,1] [,2] [,3]
#> [1,]    1    2    3
#> [2,]    4    5    6