richarddmorey / BayesFactor

BayesFactor R package for Bayesian data analysis with common statistical models.
https://richarddmorey.github.io/BayesFactor/
131 stars 48 forks source link

ttestbf: Error in is.infinite(c(x, y)) #78

Closed baranan closed 7 years ago

baranan commented 7 years ago

Using this code:

why <- data.frame(DV = c(5, 6, 7, 7, 8, 9), IV = c(1, 1, 1, 0, 0, 0))
ttestBF(DV ~ IV, data = why)

Shows me the error in my rstudio: Error in is.infinite(c(x, y)) : default method not implemented for type 'list' In R-Fiddle it shows me this error: Error : error in evaluating the argument 'data' in selecting a method for function 'compare': Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class ""formula"" to a data.frame

I can't figure out from the error messages or from the documentation what I'm doing wrong.

richarddmorey commented 7 years ago

You're not passing the formula argument explicitly. Try this:

BayesFactor::ttestBF(formula=DV ~ IV, data = why)
baranan commented 7 years ago

Yes, that works great with my example and with my actual data. Thank you very much.