DeclareDesign / estimatr

estimatr: Fast Estimators for Design-Based Inference
https://declaredesign.org/r/estimatr
Other
131 stars 20 forks source link

Unhelpful error when formula is string #349

Closed lukesonnet closed 4 years ago

lukesonnet commented 4 years ago

Should just check for whether formula is formula object or character and give informative error.

Example of bad behavior

> estimatr::lm_robust("mpg~hp", data = mtcars, cluster = wt)
Error in eval(extras, data, env) : 
  object '.__cluster%1950002076__' not found