Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

convertRowsToList

Convert rows (columns) of data.frame or matrix to lists.


Description

For each row, one list/vector is constructed, each entry of the row becomes a list/vector element.

Usage

convertRowsToList(x, name.list = TRUE, name.vector = FALSE,
  factors.as.char = TRUE, as.vector = TRUE)

convertColsToList(x, name.list = FALSE, name.vector = FALSE,
  factors.as.char = TRUE, as.vector = TRUE)

Arguments

x

[matrix | data.frame]
Object to convert.

name.list

[logical(1)]
Name resulting list with names of rows (cols) of x? Default is FALSE.

name.vector

[logical(1)]
Name vector elements in resulting list with names of cols (rows) of x? Default is FALSE.

factors.as.char

[logical(1)]
If x is a data.frame, convert factor columns to string elements in the resulting lists? Default is TRUE.

as.vector

[logical(1)]
If x is a matrix, store rows as vectors in the resulting list - or otherwise as lists? Default is TRUE.

Value

[list of lists or vectors].


BBmisc

Miscellaneous Helper Functions for B. Bischl

v1.11
BSD_2_clause + file LICENSE
Authors
Bernd Bischl [aut, cre], Michel Lang [aut], Jakob Bossek [aut], Daniel Horn [aut], Jakob Richter [aut], Dirk Surmann [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.