xfim / ggmcmc

Graphical tools for analyzing Markov Chain Monte Carlo simulations from Bayesian inference
111 stars 31 forks source link

Conflict between ggmcmc::ggs_effective and dplyr #79

Closed gosselinf closed 1 year ago

gosselinf commented 1 year ago

Dear all, I get the following error when launching ggmcmc::ggs_effective: teste<-ggmcmc::ggs_effective(D,plot=FALSE) Error indplyr::summarize(): ℹ In argument:Effective = n() * var(value)/sde0f(value). ℹ In group 1:Parameter = "coef.fixed[1]". Caused by error inn()`: ! impossible to find n() function

Backtrace: ▆

  1. ├─ggmcmc::ggs_effective(D, plot = FALSE)
  2. │ └─D %>% dplyr::group_by(Parameter) %>% ...
  3. ├─dplyr::summarize(., Effective = n() * var(value)/sde0f(value))
  4. └─dplyr:::summarise.grouped_df(., Effective = n() * var(value)/sde0f(value))
  5. └─dplyr:::summarise_cols(.data, dplyr_quosures(...), by, "summarise")
  6. ├─base::withCallingHandlers(...)
  7. └─dplyr:::map(quosures, summarise_eval_one, mask = mask)
  8. └─base::lapply(.x, .f, ...)
  9. └─dplyr (local) FUN(X[[i]], ...)
    1. └─mask$eval_all_summarise(quo)
    2. └─dplyr (local) eval() `

My version of ggmcmc is 1.5.1.1 and that of dplyr is 1.1.2 (under R4.3.0).

Cheers,

Frédéric

xfim commented 1 year ago

Dear @gosselinf ,

Thank you very much for reporting this. Indeed, you are right. I have solved it in 352a0f8139a023cc30db9f18477419f8cf4f7623.

You can now update ggmcmc from the github repository (with devtools::install_github("xfim/ggmcmc")). In the next CRAN release I will include it.

Again, thank you for reporting it. And if you have ideas to improve ggmcmc do not hesitate to reach out.