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
Tutorial needs updating
Re: Tutorial needs updating
oh yup. good catch.
-
- Posts: 4
- Joined: Sat Feb 24, 2024 9:05 am
Re: Tutorial needs updating
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.