Unused arguments for BernBeta.R?

Viewed 55

I am in a Bayesian Methods PhD course, and trying to run some BernBeta code in RStudio. (Not a regular R user!) I downloaded and installed BernBeta.R and DBDA2E-utilities.R, and they appear to be working. However, when I run any BernBeta command, R returns the error "unused arguments." This is happening to myself and another student, but our professor was able to run our code successfully, so there must be some step or install we're missing. I've checked the source and that does not appear to be the issue, which was our professor's only suggestion for resolving the error. Please send me any advice on what has gone wrong here!

This is the code I am trying to run:

source("C:/Users/megka/Documents/R files/DBDA2E-utilities.R") source("C:/Users/megka/Documents/R files/BernBeta.R")

a = 4
b=4
Prior = c(a,b)
N=1 
z=1
Data = c(rep(0,N-z), rep(1,z))
openGraph(width=5, height=7)
posterior=BernBeta(priorBetaAB=Prior, Data=Data, plotType= "Bars", showCentTend="Mode")
BernBeta(priorBetaAB=Prior, Data=Data, plotType= "Bars", showCentTend="Mode")

And this is an example of the error I am getting: Error in BernBeta(priorBetaAB = Prior, Data = Data, plotType = "Bars", : unused arguments (priorBetaAB = Prior, Data = Data, plotType = "Bars", showCentTend = "Mode")

Thank you!

1 Answers

You likely downloaded an old version of the software. The latest version is available on the companion website to Kruschke's "Doing Bayesian Data Analysis" 2nd ed., at the bottom of the Software Installation page. The BernBeta.R in there has a signature matching that used in the question.

Related