
Read the statistical result tables from a JASP, jamovi or notebook file
Source:R/stat-tables.R
read_stat_tables.RdOpens a .jasp, .omv, .spv or .ipynb file and returns every result
table as a tidy data frame together with the analysis it belongs to. No
statistics knowledge is applied here — this is the lossless extraction
layer; semantic typing happens downstream in stat_output_json() /
stat_results_long().
Value
a list with one element per result table, each a list of analysis
(the nearest heading above the table), title (the table's own caption /
first heading, when distinguishable), data (a data.frame of the table
as rendered, header row as column names), and table_index (1-based
ordinal position of this table among all tables in the rendered document —
there is no source line to attach, since a JASP/jamovi analysis is
GUI-produced). Empty list when the archive has no index.html or no
tables.
Details
Four sources are tried, in order of fidelity:
.jasp— the archive's ownanalyses.json, which holds the structured results;.omv— jamovi's protobuf-serialisedAnalysisResponseblobs, decoded natively (seeinst/schema/jamovi/PROVENANCE.md);.ipynb— the outputs saved inside each code cell of a Jupyter notebook (dispatched on extension; it is JSON, not a zip archive);any archive — the rendered
index.html, as a fallback when the above are absent or unreadable.
The structured sources are preferred because they carry each column's machine
name even when its displayed header is blank (the HTML then yields an
unnamed column), store values at full precision (a p of 0.000632 rather
than the rendered "< .001"), and mark missing cells explicitly instead of
as a rendered dash.
Examples
jasp <- system.file("extdata", "sample.jasp", package = "metacheck")
tables <- read_stat_tables(jasp)
length(tables)
#> [1] 2
tables[[1]]$data
#> v N mean sd se
#> 1 Illusion_score_sync 9 1.925925926 0.862454149896004 0.287484716632001
#> 2 control_score_sync 9 -0.148148148111111 1.19153392169221 0.397177973897402
#> 3 Illusion_score_async 9 0.703703703888889 0.963852865109736 0.321284288369912