# return coeff
get_model_pair(model = price~ I(carat^2) + cut + carat*table, data = ggplot2::diamonds)
# return raw vars
get_model_pair(price~ I(carat^2) + cut + carat*table, data= ggplot2::diamonds, pair_with = 'raw')
# correctly deal with irregular formulas
model_dirty = lm(price~ I(carat^ 2) + cut - carat:table - cut ,ggplot2::diamonds)
get_model_pair(model_dirty,pair_with = 'raw')
Run the code above in your browser using DataLab