R/fn_formulaExtractr.R

Defines functions fn_formulaExtractr

#' @useDynLib yaleBraille, .registration=TRUE
NULL
#'
# this helper function extracts x- and y-values from formulae
# called by plotting functions
fn_formulaExtractr=function(a){
  # ~~ extract the factors in the model
  f  = a[[1]]
  # ~~ extract the data-frame
  df = a[[2]]
  # ~~  reconstruct the model
  mf = model.frame(f, data = a$data, na.action = na.omit)
  # ~~ extract as y- and x values
  a$y = mf[[1]]
  a$x = mf[[2]]
  # ~~ return updated arguments set
  return(a)
}

Try the yaleBraille package in your browser

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

yaleBraille documentation built on Oct. 2, 2026, 5:08 p.m.