Page 1 of 1

Tutorial needs updating

Posted: Sun Feb 25, 2024 12:53 pm
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

Re: Tutorial needs updating

Posted: Sun Feb 25, 2024 10:43 pm
by jonathon
oh yup. good catch.

Re: Tutorial needs updating

Posted: Mon Feb 26, 2024 7:58 pm
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.