R/formula_utils.R

Defines functions f_add

Documented in f_add

#' Composing Formulas
#'
#' @param f existing formula or new variable
#' @param add variable to add or used in order to expand formula
#'
#' @export
#'
#' @examples
#' Reduce(f_add, letters)
f_add <- function(f, add){
  if(class(add) == "character") add <- as.symbol(add)
  if(class(f)   == "character") f <- as.symbol(f)
  call("+", f, add)
}
bfatemi/ninjar documentation built on Sept. 8, 2019, 7:37 p.m.