list2_to_matrix: Convert list of lists into a matrix

View source: R/utils.R

list2_to_matrixR Documentation

Convert list of lists into a matrix

Description

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)

jirilukavsky/jspsychread documentation built on Jan. 29, 2023, 5:35 p.m.