R/values.R

Defines functions values

Documented in values

values <-
function(x, data=d, ...) {

  # get actual variable name before potential call of data$x
  x.name <- deparse(substitute(x)) 

  # get data frame name
  dname <- deparse(substitute(data))

  # see if variable exists in the data frame, if x not in style Env or
  #   function call
  in.global <- df.or.global(x.name, dname, role="x", fun.name="values")
  if (!missing(x) && !in.global) .xcheck(x.name, dname, names(data))

  if (!in.global)
    x.call <- eval(substitute(data$x))
  else {  # vars that are function names get assigned to style
    x.call <- x
    if (is.function(x.call)) x.call <- eval(substitute(data$x))
  }

  print(x.call, ...)

}

Try the lessR package in your browser

Any scripts or data that you put into this service are public.

lessR documentation built on Nov. 4, 2026, 1:07 a.m.