rio (version 0.4.8)

gather_attrs: Gather attributes from data.frame variables

Description

This function moves variable-level attributes to the data.frame level

Usage

gather_attrs(x)

Arguments

x
A data.frame.

Value

Details

import attempts to standardize the return value from the various import functions to the extent possible, thus providing a uniform data structure regardless of what import package or function is used. It achieves this by storing any optional variable-related attributes at the variable level (i.e., an attribute for mtcars$mpg is stored in attributes(mtcars$mpg) rather than attributes(mtcars)). gather_attrs moves these to the data.frame-level (i.e., in attributes(mtcars)).

See Also

import

Examples

Run this code
e <- import("http://www.stata-press.com/data/r13/auto.dta")
str(e)
g <- gather_attrs(e)
str(attributes(e))
str(g)

Run the code above in your browser using DataLab