gather_attributes: Create a data-frame of attributes

Description Usage Arguments Value

Description

This function is intended to abstract over the pattern of writing code like data.frame(x = trials %@% "x", ZName = trials %@% "z") by instead allowing us to write gather_attributes(trials, c("x", ZName = z)).

Usage

1
gather_attributes(x, attrs, omit_na = FALSE)

Arguments

x

a list of objects with attributes

attrs

a character vector. If an element in the vector is named, the name is used as the new (column) name for that attribute's column in the resulting data-frame.

omit_na

whether to drop columns with all NA values

Value

a data-frame with a column for each of the attributes in attrs. By default, non-existent attributes will be stored with NA values and strings are not factors.


tjmahr/lookr documentation built on May 31, 2019, 3:41 p.m.