KarolineHuth / easybgm

CRAN download: https://cran.r-project.org/web/packages/easybgm/index.html
0 stars 4 forks source link

`plot_edgeevidence` with `split = TRUE` should show figures side by side #43

Closed vandenman closed 1 year ago

vandenman commented 1 year ago

This code

fit2 <- easybgm(data, type = "ordinal",
               iter = 1000, save = TRUE,
               centrality = TRUE)

rr <- plot_edgeevidence(fit2, split = TRUE)

create 2 plots. But the default behavior in RStudio is to show only the last one.

A user would probably prefer:

layout(t(1:2))
plot_edgeevidence(fit2, split = TRUE)

Perhaps add something like

if (split) {

  # get current par settings and reset them at the end of this function
  old_par <- graphics::par(no.readonly = TRUE)
  on.exit(graphics::par(old_par))

  # two columns, 1 row
  par(mfrow = c(1, 2))

}

in addition:

KarolineHuth commented 1 year ago

Re layout: kept as 1:1, so users are able to extract the plots individually. but added a description on adding a layout argument. also shown how to in the example Re split: updated as split = FALSE Re invisibly: implemented