ez.pasteattr: paste attr to a df or vector, from a list of list, or list...

View source: R/frame.R

ez.pasteattrR Documentation

paste attr to a df or vector, from a list of list, or list respectively

Description

paste attr to a df or vector, from a list of list, or list respectively

Usage

ez.pasteattr(x, col = NULL, attrs = NULL, ...)

Arguments

x

a data frame or a vector

col

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

attrs

a list of list ($sex $sex$label $sex$labels for df) or list ($label $labels for vector). Works fine even if the list or list of list is empty, or if list has $sex $race but df has 'sex', no 'race'
when only two parameters passed in, will be interpreted as (x,attrs) with col=NULL
e.g., attrs=list(sex=list(labels=c("male"=1,"female"=2))

Value

returns a new data frame or vector


jerryzhujian9/ezR documentation built on June 12, 2025, 6:36 p.m.