Tutorial needs updating

Everything related to the development of modules in jamovi
Post Reply
paulpearson
Posts: 4
Joined: Sat Feb 24, 2024 9:05 am

Tutorial needs updating

Post by paulpearson »

Hi all,

I'm new to Jamovi and want to develop a Jamovi module for simulation-based inference tests (please let me know if you're interested in that). I was working through the tutorial

https://dev.jamovi.org/tuts0104-impleme ... lysis.html

and the last code block on the bottom of this webpage was not working for me. I suggest the code

###### begin code

ttestISClass <- R6Class("ttestISClass",
inherit=ttestISBase,
private=list(
.run=function() {

formula <- constructFormula(self$options$dep, self$options$group)
formula <- as.formula(formula)

results <- t.test(formula, self$data)

self$results$text$setContent(results)
})
)

####### end code

be replaced by the following code that does not have ttestISCLass, and also uses jmvcore::constructFormula() instead of just constructFormula(). The following code did work for me.

###### begin code

ttestClass <- R6::R6Class("ttestClass",
inherit=ttestBase,
private=list(
.run=function() {

formula <- jmvcore::constructFormula(self$options$dep, self$options$group)
formula <- as.formula(formula)

results <- t.test(formula, self$data, var.equal=self$options$varEq)

self$results$text$setContent(results)
})
)

####### end code

Thanks!
Paul
User avatar
jonathon
Posts: 2627
Joined: Fri Jan 27, 2017 10:04 am

Re: Tutorial needs updating

Post by jonathon »

oh yup. good catch.
paulpearson
Posts: 4
Joined: Sat Feb 24, 2024 9:05 am

Re: Tutorial needs updating

Post by paulpearson »

I also forgot to mention the R6::R6Class in the working code that's just R6Class in the code that didn't work for me.
Post Reply