相关疑难解决方法(0)

在不使用`quote`的情况下推迟表达式评估

我创建了以下函数/示例作为在表中显示变量标签的通用方法,依此类推:

#' Function to prettify the output of another function using a `var.labels` attribute
#' This is particularly useful in combination with read.dta et al.
#' @param dat A data.frame with attr `var.labels` giving descriptions of variables
#' @param expr An expression to evaluate with pretty var.labels
#' @return The result of the expression, with variable names replaced with their labels
#' @examples
#' 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, …
Run Code Online (Sandbox Code Playgroud)

r lazy-evaluation

5
推荐指数
1
解决办法
866
查看次数

标签 统计

lazy-evaluation ×1

r ×1