I’d like to be able to format the results from a code block in the Rj editor. Is there any way for me to construct output in my script so that jamovi interprets it as it would the output of a module?
E.g. the example module in the Developer Hub explains how one constructs the table using yaml in the .r.yaml file, and then populates it from within the module.
Can we do anything roughly similar from within the Rj editor? Is there any way for me to format the output of my code so that Jamovi goes "aha! He's trying to make a pretty Jamovi-style table"?
Creating pretty tables from Rj editor
Re: Creating pretty tables from Rj editor
hmm ... it can be done, but it's pretty involved.
something like:
library(jmvcore)
t <- Table$new(title="Hello")
invisible(t$addColumn('fred'))
invisible(t$addColumn('jim'))
invisible(t$addColumn('bob'))
t$addRow(rowKey=1, values=list(fred=8, jim=3, bob=4))
t$addRow(rowKey=2, values=list(fred=3, jim=8, bob=5))
t
cheers
something like:
library(jmvcore)
t <- Table$new(title="Hello")
invisible(t$addColumn('fred'))
invisible(t$addColumn('jim'))
invisible(t$addColumn('bob'))
t$addRow(rowKey=1, values=list(fred=8, jim=3, bob=4))
t$addRow(rowKey=2, values=list(fred=3, jim=8, bob=5))
t
cheers
Re: Creating pretty tables from Rj editor
In all truth, that's actually a bit less involved than I thought! Thank you so much. This is perfect.