$addFootnote works in jamovi but not in R
Posted: Wed Mar 01, 2023 6:27 pm
Copying the style of ttestIS from the jmv package, I am displaying analysis-specific error messages using $addFootnote. This works when I test the module in jamovi but not when I test it in R.
Specifically, the test is a permutation test and if the number of permutations are too high, it cannot compute a result. To check for this I defined in lines 31-33 of https://github.com/karchjd/bmtest/blob/master/R/bmtest.b.R
The check_error function this belongs to is called in line 193
And if res_full is an error a footnote is added (lines 222 and 233)
Again, this whole process essentially is the same as in ttestIS.
I test this using.
This should add the error message as footnote to the table. It does so if I run the test using jamovi but not using R. What is going on?
Specifically, the test is a permutation test and if the number of permutations are too high, it cannot compute a result. To check for this I defined in lines 31-33 of https://github.com/karchjd/bmtest/blob/master/R/bmtest.b.R
Code: Select all
if (total_perm >= 40116600L) {
res <- jmvcore::createError("Number of needed permutations too large to be computationally feasible. Use one of the other two options.")
}
Code: Select all
res_full <- check_error(dataTTest, check_n = TRUE)
Code: Select all
message <- jmvcore::extractErrorMessage(res_full)
...
ttestTable$addFootnote(rowKey = depName, "stat[fullPerm]", message)
Again, this whole process essentially is the same as in ttestIS.
I test this using.
Code: Select all
df <- data.frame(
dep = rnorm(100),
group = rep(letters[1:2], each = 50)
)
bmtest(df, vars = "dep", group = "group", fullPerm = TRUE)