ez.copyattr: copy attr of a df or vector, save as a list of list, or list...

View source: R/frame.R

ez.copyattrR Documentation

copy attr of a df or vector, save as a list of list, or list respectively

Description

copy attr of a df or vector, save as a list of list, or list respectively

Usage

ez.copyattr(x, col = NULL, attrs = c("label", "labels"), ...)

Arguments

x

a data frame or a vector

col

evaluated by ez.selcol(x,col). Or, NULL=all cols.

attrs

variable label: c('variable.labels', 'label'); value labels: c('value.labels', 'labels'). run names(attributes(x)) to see all attributes. But be cautionous that some attributes are "dangerous" to directly copy and paste this way (eg., levels,class)

Value

returns a list of list (x is df), or list (x is vector). Works fine even if x, its col, does not have attrs.


jerryzhujian9/zmisc documentation built on March 9, 2024, 12:49 a.m.