drsimonj / twidlr

data.frame-based API for model and predict functions
Other
59 stars 9 forks source link

Create functions to set/get formula attribute #28

Open drsimonj opened 7 years ago

drsimonj commented 7 years ago

Many twidlr methods involve setting and getting a formula as an attribute. It's a bit messy in base code. Eg...

attr(object, "formula")

Instead, create wrapper functions like set_formula and get_formula. Eg...

get_formula <- function(object) attr(object, "formula")