danheck / TreeBUGS

R package for fitting hierarchical multinomial processing tree (MPT) models
12 stars 5 forks source link

could not find function "fitModel" #7

Open psyxusheng opened 3 years ago

psyxusheng commented 3 years ago

I runed an example code like:

EQNfile <- system.file("MPTmodels/2htsm.eqn", package="TreeBUGS")
d.encoding <- subset(arnold2013, group == "encoding", select = -(1:4))
fit <- betaMPT(EQNfile, d.encoding, n.thin=5,
               restrictions=list("D1=D2=D3","d1=d2","a=g"))

plot(fit, parameter = "mean", type = "default")
summary(fit)

how ever it gets : could not find function "fitModel"

What causes this?

danheck commented 3 years ago

Unfortunately, I cannot reproduce this issue on Windows or Linux (using TreeBUGS 1.4.5, R 4.0.3, JAGS 4.3.0 and RStudio 1.3.1073). Did you update all packages? In specific, did you check whether JAGS is correctly installed and works within R (you can do this by installing and loading the rjags package)?

The function fitModel is an internal function of the TreeBUGS package. If the package has been loaded with library(TreeBUGS), the function should be available within the scope of the other functions such as betaMPT. Can you run the code when using traitMPT(...) instead of betaMPT(...)?