Closed sam-crawley closed 4 years ago
For brms models, if a term had an underscore in it, the string splitting got confused for ran_vals.
e.g.
data("sleepstudy") sleepstudy$Days_extra <- sleepstudy$Days model.brms <- brm(Reaction ~ Days_extra + (Days_extra|Subject), sleepstudy, chains = 2) tidy(model.brms, effect = "ran_vals")
This would result in "Days" getting added to the levels column, and "extra" in the term column.
This commit fixes this by replacing strsplit with a regex using str_match_all.
thanks! I'm hoping I (or you) can modify the existing tests so that they check for this issue (i.e. regression tests). May pull this first anyway ...
Yes, I'll add a test shortly.
also, looks (based on TravisCI) as though this fails the test here?
Should be good now.
For brms models, if a term had an underscore in it, the string splitting got confused for ran_vals.
e.g.
This would result in "Days" getting added to the levels column, and "extra" in the term column.
This commit fixes this by replacing strsplit with a regex using str_match_all.