R/utils.R

Defines functions col_to_predict

Documented in col_to_predict

#' Retreives column to predict from formula
#'
#' @param formula that is to be parsed
#' @return a string with the column name on the lefthand side of formula
#' @examples
#' col_to_predict(y ~ x + z)
#' col_to_predict(y ~ .)
#' @export
col_to_predict <- function(formula){
  as.character(formula)[2]
}
koaning/baseliner documentation built on May 5, 2019, 3:54 p.m.