Learn R Programming

taRifx (version 1.0.6.2)

prettify: Function to prettify the output of another function using a `var.labels` attribute This is particularly useful in combination with read.dta et al.

Description

Function to prettify the output of another function using a `var.labels` attribute This is particularly useful in combination with read.dta et al.

Usage

prettify(dat, expr)

Arguments

dat

A data.frame with attr `var.labels` giving descriptions of variables

expr

An expression to evaluate with pretty var.labels

Value

The result of the expression, with variable names replaced with their labels

Examples

Run this code
# NOT RUN {
testDF <- data.frame( a=seq(10),b=runif(10),c=rnorm(10) )
attr(testDF,"var.labels") <- c("Identifier","Important Data","Lies, Damn Lies, Statistics")
prettify( testDF, quote(str(dat)) )
# }

Run the code above in your browser using DataLab