I am trying to produce a 2 x 2 contingency table as output and have lifted code from jamovi github yaml and r files, specifically from conttablespaired
A consistent error that I get is for the construction of .(' ') in the .b.R file, e.g. in the line:
subTitles <- c(.('Count'), .('% within row'), .('% within column'))
Debug in jamovi states: could not find function "."
Would appreciate some guidance. Thanks
2x2 contingency table
Re: 2x2 contingency table
are you using the latest jamovi?
jonathon
jonathon
Re: 2x2 contingency table
I have now installed latest verstion 2.3.2.0 and get the same result, see screenshot here:
https://www.dropbox.com/s/tzhkbj4v0ukza ... t.png?dl=0
I have been using an older version of the conttablespaired.b.R but the relevant code looks the same in the most recent available on github. I am sorry, I am not familiar with the use of dots in the concatenate R function, e.g.
c(.('Count'), .('% within row'), .('% within column'))
which seems to be the problem.
https://www.dropbox.com/s/tzhkbj4v0ukza ... t.png?dl=0
I have been using an older version of the conttablespaired.b.R but the relevant code looks the same in the most recent available on github. I am sorry, I am not familiar with the use of dots in the concatenate R function, e.g.
c(.('Count'), .('% within row'), .('% within column'))
which seems to be the problem.
Re: 2x2 contingency table
you can ditch the dots if you like ... they are for translations.
alternatively, import the . from jmvcore:
https://github.com/jamovi/jmv/blob/master/NAMESPACE#L31
cheers
jonathon
alternatively, import the . from jmvcore:
https://github.com/jamovi/jmv/blob/master/NAMESPACE#L31
cheers
jonathon
Re: 2x2 contingency table
Great, thanks, that has got rid of that problem and it now is attempting to give a contingency table labelled correctly.
However, I am getting another error in the .init = function() section where it says "attempt to apply non-function", see screenshot:
https://www.dropbox.com/s/m9d7z8y3od70v ... 2.png?dl=0
Perhaps it's something to do with the object properties of freqs$ ? Such as freqs$addColumn
Or perhaps I should alter other constructions involving dots, such as name='.total[count]' ?
However, I am getting another error in the .init = function() section where it says "attempt to apply non-function", see screenshot:
https://www.dropbox.com/s/m9d7z8y3od70v ... 2.png?dl=0
Perhaps it's something to do with the object properties of freqs$ ? Such as freqs$addColumn
Or perhaps I should alter other constructions involving dots, such as name='.total[count]' ?
Re: 2x2 contingency table
Please ignore previous, this is the problem:
Debug
Error in bitwOr(self$format, format): object 'Cell.BEGIN_GROUP' not found
private$.init()
freqs$addFormat(rowNo = i, 1, Cell.BEGIN_GROUP)
self$getCell(col = col, rowNo = rowNo, rowKey = rowKey)$addFormat(format)
bitwOr(self$format, format)
Debug
Error in bitwOr(self$format, format): object 'Cell.BEGIN_GROUP' not found
private$.init()
freqs$addFormat(rowNo = i, 1, Cell.BEGIN_GROUP)
self$getCell(col = col, rowNo = rowNo, rowKey = rowKey)$addFormat(format)
bitwOr(self$format, format)
Re: 2x2 contingency table
same as before, you need to import Cell.BEGIN_GROUP from jmvcore.
cheers
cheers
Re: 2x2 contingency table
Thanks, I have put the following in the NAMESPACE file:
import(jmvcore)
importFrom(jmvcore,.)
importFrom(jmvcore,Cell.BEGIN_GROUP)
importFrom(jmvcore,Cell.END_GROUP)
importFrom(jmvcore,Cell.BEGIN_END_GROUP)
However I now get the error in the post I said to ignore, namely
"attempt to apply non-function", see same screenshot:
https://www.dropbox.com/s/m9d7z8y3od70v4z/jam_screenshot2.png?dl=0
import(jmvcore)
importFrom(jmvcore,.)
importFrom(jmvcore,Cell.BEGIN_GROUP)
importFrom(jmvcore,Cell.END_GROUP)
importFrom(jmvcore,Cell.BEGIN_END_GROUP)
However I now get the error in the post I said to ignore, namely
"attempt to apply non-function", see same screenshot:
https://www.dropbox.com/s/m9d7z8y3od70v4z/jam_screenshot2.png?dl=0
Re: 2x2 contingency table
you may find it easier to develop your module in rstudio, as it will be able to give you better diagnostics. alternatively, you can add print statements, and run jamovi at the terminal. once you narrow it down to the line of code that's responsible, i think this will be pretty clear (unfortunately, R's error messages aren't great like that).
that error means you're doing something like:
fred()
and fred isn't actually a function.
cheers
jonathon
that error means you're doing something like:
fred()
and fred isn't actually a function.
cheers
jonathon
Re: 2x2 contingency table
Great advice, many thanks