I was debugging another issue with offsets and created a simple example to test, and ran into this problem:
> library(modelbased)
> fit <- lm(mpg ~ disp + offset(cyl), data=mtcars)
> estimate_means(fit)
Error: Model contains no categorical predictor. Please specify `by`. Or use `by
= NULL` to predict the grand mean.
> estimate_means(fit, by=NULL)
Error in startsWith(my_args$by, model_offset) : non-character object(s)
That check comes from here. If there's no offset() term, it works.
I don't know if there's an actual use case for this -- I was just figuring out what was wrong with my other offset() issue, and I may file a bug about it if I narrow it down -- but it's unexpected that the error message tells you to do something that immediately doesn't work.
I was debugging another issue with offsets and created a simple example to test, and ran into this problem:
That check comes from here. If there's no
offset()term, it works.I don't know if there's an actual use case for this -- I was just figuring out what was wrong with my other
offset()issue, and I may file a bug about it if I narrow it down -- but it's unexpected that the error message tells you to do something that immediately doesn't work.