Closed jasonyang5 closed 5 years ago
I would generally recommend working with formula objects directly, instead of editing strings or pasting them together. There are many helper functions in the stats package:
But you should be easily be able to convert from string to formula using as.formula()
- the new version of rlang is apparently no longer doing the conversion for you. So maybe try shimming that in:
lm_robust(as.formula("a ~ b"), df) # theoretically works
I'm closing this, as I don't think we want to support strings as the formula.
When running lm_robust while passing the formula as a string, I get the following warning and error:
Error in formula[[2]] : subscript out of bounds In addition: Warning message: Assigning non-quosure objects to quosure lists is deprecated as of rlang 0.3.0. Please coerce to a bare list beforehand with
as.list()
Here is some code that can replicate the problem:
I know for a fact that string formulas worked a few months ago, as I used them in functions for a paper.
For the time being, are there other ways you can 'program' lm_robust?
Thank you!