I’m fitting a model with two group level parameters, i.e. vectors x0[]
and y0
. I’m trying to use facet_wrap
to split the plotting of parameter summaries to different facets with different axes. I can get a result (see below), but it includes all the variables (i.e. rows for the y0[]
values in the facet plotting x0[]
and rows for the x0[]
values in the facet plotting y0[]
).
Question: How do I prevent the empty rows in each facet?
Here’s the relevant code.
tmp_plots <- stan_plot(model, pars = c("x0", "y0", "theta"))
tmp_plots +
facet_wrap(vars(grepl("x0.*", params)),
scales = "free")