Open Schmidtpk opened 3 years ago
You should be able to handle this using the sep
argument to spread_draws()
/ gather_draws()
. Something like spread_draws(..., sep = ", ")
should do it, or if the presence of a space is inconsistent (if you sometimes have none or sometimes have more than one) you could do something like spread_draws(..., sep = ", *")
It does raise the question of whether the default value of sep
should be changed. The current default is "[, ]"
, i.e., one comma or one space. Could change to something like "[, ] *"
, i.e. one comma or space optionally followed by any number of spaces. I doubt that would break anyone's existing code.
Something like spread_draws(..., sep = ", ")
Thanks. This works fine; same for the general version.
Maybe an alternative would be to throw a suggestive error or warning message in case the default change is deemed to risky. At least for me it took some time to figure out that the difference in dimnames was what caused the problem.
Also, nimble could possibly just adhere to the standards. I'll post an issue there, too.
Good point that the error when a spec breaks could suggest use of sep
.
TODOs for my benefit:
sep
arg to something like "[, ] *"
sep
if it seems appropriate
If dimnames in an mcmc.list have empty spaces, the code breaks with
This happens for example when using nimble, which has dimnames
instead of
Of course, users can just manipulate the names before using tidybayes with
but a change in tidybayes would make it much easier.