xfim / ggmcmc

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

ci fails when a list of dataframes is passed #38

Closed azvoleff closed 9 years ago

azvoleff commented 9 years ago

The manual for ci implies a list of data.frames can be passed to the function and confidence intervals calculated for each model (that https://github.com/xfim/ggmcmc/blob/master/R/functions.R#L95).

When I try this I get:

Error in UseMethod("group_by_") : 
  no applicable method for 'group_by_' applied to an object of class "list"

A glance at the code shows that group_by is run on the input to the function - this will always fail if a list is passed.

xfim commented 9 years ago

Thank you for noticing it, @azvoleff. You are right.

But at this point, I am not sure of what is the best way to proceed. I am tempted to delete from the manual the capacity to work directly with lists and leave this to users. I think that this is the most consistent behaviour considering the following:

But if you think that this is a clear improvement I would consider implementing it.

What is your opinion?

azvoleff commented 9 years ago

I agree - best to keep things simple and consistent, and require a data.frame as input. I was going to suggest that allowing to also group by a Model column, if present would be helpful, but on second thought, probably best to just revise the docs to drop the implied support for lists. When calculating CIs for multiple models the user can always just use a foreach loop.

Thanks again for the great package!

xfim commented 9 years ago

Solved at commit 40789bf5c475cbf63ff12bc25eaed11a07d54feb.