dftlov: Turn data.frame to list of named vectors.

Description Usage Arguments Value Author(s) Examples

Description

Turn a data.frame into a list of named vectors, splitting by another variable.

Usage

1
dftlov(data, values, ids, by)

Arguments

data

A data.frame-like object (data.frame, tibble, ...).

values

A character identifying the column holding the values.

ids

A character identifying the column holding the names.

by

A character identifying the column holding the factor for splitting.

Value

A list of name vectors.

Author(s)

Dominik Mueller

Examples

1
2
3
4
dat <- data.frame(chrom = c(1L, 1L, 2L, 2L, 3L, 3L),
pos = c(1.4, 5.5, 1.2, 6.8, 3.3, 5.4),
id = c('m1', 'm2', 'm3', 'm4', 'm5', 'm6'))
dftlov(dat, values = 'pos', ids = 'id', by = 'chrom')

DominikMueller64/dmisc documentation built on May 6, 2019, 2:52 p.m.