patperry / r-mbest

Moment-Based Estimation for Hierarchical Models (R Package)
Apache License 2.0
24 stars 6 forks source link

‘|’ not meaningful for factors #7

Open jasonchuanhe opened 7 years ago

jasonchuanhe commented 7 years ago

This works:

mhglm(outcome ~ predictor + (1 | group), family=Gamma, data=df)

But this doesn't:

f = as.formula("outcome ~ predictor + (1 | group)")
mhglm(f, family=Gamma, data=df)

The error is:

Error in mhglm(f, data = df, family = Gamma) : 
  Invalid grouping factor specification, group
In addition: Warning message:
In Ops.factor(1, group) : ‘|’ not meaningful for factors
patperry commented 7 years ago

Thanks for reporting this. @kschmaus have you seen this before?