malcolmbarrett / causalpie

🥧 An R package for easily creating and visualizing sufficient-component cause models
Other
7 stars 1 forks source link

Error in map2() when running the example on README #1

Open mbcann01 opened 1 year ago

mbcann01 commented 1 year ago

Hi @malcolmbarrett ,

I was excited to come across this package. Thanks for making it!

I attempted to run the following example code from the README:

causes <- causify(
  sc(A = 0, B = 1), 
  sc(A = 0, E = 1), 
  sc(B = 1, E = 1)
)

I returned the following error:

Error in `map2()`:
ℹ In index: 1.
Caused by error in `vec_rbind()`:
! Can't combine `..1$value` <double> and `..2$value` <character>.
Backtrace:
  1. causalpie::causify(...)
 13. dplyr::add_row(., component = u_name, value = u_value)
 14. tibble:::rbind_at(.data, df, pos)
 15. vctrs::vec_rbind(old, new)

I took a quick look at the script for the causify() function, but it wasn't immediately obvious to me what the problem was. My best guess is that something broke when dplyr switched over to using vctrs.

It looks like your last push to this repo was in 2018, so I'm not sure if you have any interest in trying to fix this. I thought I would let you know just in case. If I can find the time, I might try to figure it out and send you a pull request.

Thanks again! Brad

malcolmbarrett commented 1 year ago

As a matter of fact, I'm very interested in revitalizing this package and getting it on CRAN. I don't know yet exactly what my timeline is, though. Happy to take a PR if you don't want to wait. I think you're right about the cause (har har). It's probably a trivial data type mismatch somewhere.