| Title: | Polished, Editable Tables and Statistical Results |
|---|---|
| Description: | Sends supported 'R' objects to the 'Mellio' web app and creates polished, editable statistical tables in 'R'. The 'mellio_open' interface handles common hypothesis tests, model objects, model comparisons, descriptive summaries, tabular data, plots, and image files. The 'melliotab' interface formats data frames, model summaries, correlation matrices, and side-by-side comparison tables with APA-style numeric formatting, confidence intervals, table notes, and optional significance markers. Manual table helpers can copy or save 'melliotab' output as 'HTML', 'LaTeX', or 'Markdown' when file-based handoff is needed. Payloads include package-version metadata to support reproducible reporting and software citation. |
| Authors: | Melih Sahin [aut, cre] |
| Maintainer: | Melih Sahin <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.1 |
| Built: | 2026-07-07 08:20:04 UTC |
| Source: | https://github.com/nicomel1907/mellio-r |
mellio provides two main workflows:
mellio_open() sends supported R objects to the Mellio web app.
Statistical results open as Result Cards, tabular data opens in the
Tables workspace, and supported plots or image files open in Figures.
melliotab() creates polished, editable tables directly in R for data
frames, model summaries, correlation matrices, and model comparisons.
mellio_open() inputsmellio_open() supports common htest objects such as t.test(),
cor.test(), and chisq.test(); model objects such as lm, glm,
aov, lme4 mixed models, lavaan fits, survival models, ordinal
models, and selected optional-package result classes; data frames,
matrices, and base table objects; ggplot2, lattice, htmlwidget,
recorded plot, and image-file inputs.
melliotab() workflowUse melliotab(x) to create a table, then apply table modifiers such as
mt_title(), mt_note(), mt_decimals(), mt_format_ci(),
mt_sig_stars(), mt_spanner(), mt_section_title(), and
mt_simplify_headers(). Pass two or more model objects to
melliotab(m1, m2, ...) to create a side-by-side model comparison table.
For file-based handoff, use mt_copy() or mt_save() to copy or save a
finished table as HTML, LaTeX, or Markdown.
| Function or option | What it does | Common values |
melliotab() |
Creates a formatted table in R | style = "apa7" or "ieee" |
mellio_open() |
Opens supported objects in Mellio | Models, tests, tables, data, plots |
style / mt_set_style() |
Sets or changes table style | "apa7", "ieee" |
title / mt_title() |
Sets the table title | Text |
number / mt_number() |
Sets the table number | Number or text |
note / mt_note() |
Adds a table note | Text |
source / mt_source() |
Adds source text | Text |
decimals, p_decimals / mt_decimals() |
Controls rounding | decimals = 2, p_decimals = 3 |
mt_sig_stars() |
Adds significance stars to an existing table | remove_p = TRUE or FALSE |
mt_remove_leading_zeros() |
Controls leading zeros | TRUE, FALSE |
mt_diagonal() |
Formats correlation matrices | mode = "dash"; triangle = "lower" |
mt_spanner() |
Adds a spanning column header | Label text and columns |
mt_section_title() |
Adds a section-title row | before = or after = a row number |
mt_indent() |
Indents selected rows | rows =; level = 1, 2, or 3 |
mt_copy() / mt_save() |
Copies or saves a table | Clipboard, .html, .tex, .md
|
By default, Mellio payloads include R/package-version metadata and data
fingerprints where available. Local machine details such as user name,
host name, working directory, git state, and script path are not included
unless you opt in with options(mellio.provenance = "full"). Set
options(mellio.provenance = FALSE) to omit provenance metadata.
Use citation("mellio") to get the package citation.
Maintainer: Melih Sahin [email protected]
mellio_open(), melliotab(), mt_save(),
mt_copy()
Automatically detects the output format and uses the appropriate backend.
knit_print.melliotab(x, ...)knit_print.melliotab(x, ...)
x |
A melliotab object |
... |
Additional arguments |
knitr output
Reads the active selection in the RStudio editor, evaluates it in the global environment, and opens the result as a Result Card in the Mellio web app. The selected text is preserved as the displayed call so the saved card still says e.g. "t.test(score ~ group, data = df)" rather than the evaluated variable.
mellio_addin_send()mellio_addin_send()
Registered via inst/rstudio/addins.dcf. Appears in RStudio's
Addins menu once the package is loaded.
Invisibly NULL. Side effect: opens the browser at Mellio.
Other R bridge:
mellio_capture(),
mellio_compare(),
mellio_open(),
mellio_payload(),
mellio_to_json(),
print.mellio_payload()
if (interactive() && requireNamespace("rstudioapi", quietly = TRUE) && rstudioapi::isAvailable()) { # Highlight t.test(extra ~ group, data = sleep) in RStudio # Addins menu -> Send to Mellio mellio_addin_send() }if (interactive() && requireNamespace("rstudioapi", quietly = TRUE) && rstudioapi::isAvailable()) { # Highlight t.test(extra ~ group, data = sleep) in RStudio # Addins menu -> Send to Mellio mellio_addin_send() }
Lets the Lab switch the multiple-comparison adjustment without refitting the
model: it reuses an aov object already held in the (WebR) session and runs the
contrasts straight through mellio_payload()'s emmGrid method.
mellio_anova_pairwise(fit, by = NULL, adjust = "tukey")mellio_anova_pairwise(fit, by = NULL, adjust = "tukey")
fit |
A fitted one-way |
by |
Optional grouping factor name; inferred from the model when |
adjust |
Multiple-comparison adjustment passed to |
A pairwise-comparisons payload (table fields + pairwise_forest).
Convenience wrapper for base R plots. Call after producing a base plot
with plot(), hist(), barplot(), or another graphics function.
mellio_capture(...)mellio_capture(...)
... |
Arguments passed to |
Invisibly, the Mellio URL string.
Other R bridge:
mellio_addin_send(),
mellio_compare(),
mellio_open(),
mellio_payload(),
mellio_to_json(),
print.mellio_payload()
if (interactive()) { plot(mtcars$wt, mtcars$mpg) mellio_capture( title = "Fuel efficiency by weight", number = 1, browse = FALSE ) }if (interactive()) { plot(mtcars$wt, mtcars$mpg) mellio_capture( title = "Fuel efficiency by weight", number = 1, browse = FALSE ) }
Builds a hierarchical-regression comparison payload from two or more
nested model objects. Unlike mellio_payload(anova(m1, m2)), this keeps the
original models available so Mellio can report model R^2, adjusted R^2,
Delta R^2, and the nested-model F-change.
mellio_compare(..., labels = NULL, .call = NULL)mellio_compare(..., labels = NULL, .call = NULL)
... |
Nested model objects, usually |
labels |
Optional model labels. Defaults to |
.call |
Optional call string for provenance / display. |
A mellio_payload object.
Other R bridge:
mellio_addin_send(),
mellio_capture(),
mellio_open(),
mellio_payload(),
mellio_to_json(),
print.mellio_payload()
m1 <- lm(mpg ~ wt + hp, data = mtcars) m2 <- lm(mpg ~ wt + hp + cyl, data = mtcars) p <- mellio_compare(m1, m2) p$typem1 <- lm(mpg ~ wt + hp, data = mtcars) m2 <- lm(mpg ~ wt + hp + cyl, data = mtcars) p <- mellio_compare(m1, m2) p$type
Unified entry point for sending R objects to the Mellio web app. Statistical results and tables open as Stats Result Cards; plots open in the web app's Figures editor.
mellio_open(x, ..., browse = TRUE, .call = NULL)mellio_open(x, ..., browse = TRUE, .call = NULL)
x |
An R object supported by Mellio. |
... |
Additional arguments forwarded to the relevant Mellio constructor or payload method. |
browse |
Open the browser? |
.call |
Internal captured user call for provenance. |
Invisibly, the URL string.
mellio_open() routes objects by class:
Statistical results such as htest, lm, glm, aov, lavaan,
mixed-model, survival, ordinal, mediation, and selected optional-package
result classes open as structured Result Cards.
Data frames, matrices, base table objects, and non-statistical
melliotab objects open in the Tables workspace.
ggplot2, lattice, htmlwidget, recorded plot, and supported image-file
inputs open in Figures.
Optional model and figure integrations use packages listed in Suggests.
If an optional package is not installed, the corresponding object class is
skipped or reported with an informative message.
mellio_open() opens https://www.mellioapp.com by default. Advanced
users can set options(mellio.editor_url = "https://..."), but should only
use a trusted Mellio deployment. The R payload is encoded in the URL
fragment. URL fragments are not sent as HTTP requests to the server, but the
full URL can still be visible to the browser, the opened web app, browser
history, extensions, and anyone the URL is shared with.
By default, Mellio payloads include R/package-version metadata and data
fingerprints where available. Local machine details are opt-in:
options(mellio.provenance = "full"). To omit provenance metadata, use
options(mellio.provenance = FALSE).
Plots are transported through the URL hash. Very large images may exceed
browser URL limits; reduce width, height, or dpi, or save the image and
upload it manually in Mellio.
Other R bridge:
mellio_addin_send(),
mellio_capture(),
mellio_compare(),
mellio_payload(),
mellio_to_json(),
print.mellio_payload()
if (interactive()) { mellio_open(t.test(extra ~ group, data = sleep)) m1 <- lm(Ozone ~ Temp, data = airquality) m2 <- lm(Ozone ~ Temp + Wind, data = airquality) m3 <- lm(Ozone ~ Temp + Wind + Solar.R, data = airquality) mellio_open( m1, m2, m3, labels = c("Step 1", "Step 2", "Step 3"), dep.var.labels = "Ozone concentration" ) }if (interactive()) { mellio_open(t.test(extra ~ group, data = sleep)) m1 <- lm(Ozone ~ Temp, data = airquality) m2 <- lm(Ozone ~ Temp + Wind, data = airquality) m3 <- lm(Ozone ~ Temp + Wind + Solar.R, data = airquality) mellio_open( m1, m2, m3, labels = c("Step 1", "Step 2", "Step 3"), dep.var.labels = "Ozone concentration" ) }
Converts a supported R model or test object into a structured JSON
payload (a "Result Card") that Mellio renders in the Stats section.
Pure and offline — no network calls. Use mellio_open() to additionally
open the payload in the Mellio web app.
## S3 method for class 'aov' mellio_payload(x, focal = NULL, controls = NULL, ..., .call = NULL) ## S3 method for class 'summary.aov' mellio_payload( x, focal = NULL, controls = NULL, ..., .call = NULL, .env = parent.frame() ) ## S3 method for class 'aovlist' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'afex_aov' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'anova' mellio_payload(x, focal = NULL, controls = NULL, ..., .call = NULL) ## S3 method for class 'brmsfit' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'stanreg' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'glm' mellio_payload( x, ..., .call = NULL, focal = NULL, controls = NULL, exponentiate = FALSE, conf.int = TRUE, conf.level = 0.95 ) ## S3 method for class 'rlm' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'gam' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'lme' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'glmmTMB' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'kmeans' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'hclust' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'randomForest' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'coxph' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'numeric' mellio_payload(x, name = NULL, ..., .call = NULL) ## S3 method for class 'summaryDefault' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'fa' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'principal' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'factanal' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'prcomp' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'effectsize_table' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'effectsize_difference' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'effectsize_anova' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'see_effectsize_table' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'FitDiff' mellio_payload(x, what = NULL, ..., .call = NULL) ## S3 method for class 'geeglm' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'glmerMod' mellio_payload( x, ..., .call = NULL, exponentiate = FALSE, conf.int = TRUE, conf.level = 0.95 ) ## S3 method for class 'htest' mellio_payload(x, .data = NULL, ..., .call = NULL, .env = parent.frame()) ## S3 method for class 'lavaan' mellio_payload( x, focal = NULL, diagram_omit = NULL, standardized = TRUE, ..., .call = NULL ) ## S3 method for class 'lm' mellio_payload(x, focal = NULL, controls = NULL, ..., .call = NULL) ## S3 method for class 'lmerMod' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'manova' mellio_payload( x, tests = c("Pillai", "Wilks", "Hotelling-Lawley", "Roy"), ..., .call = NULL ) ## S3 method for class 'summary.manova' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'mediate' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'summary.mediate' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'multinom' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'polr' mellio_payload(x, ..., .call = NULL, conf.int = TRUE, conf.level = 0.95) ## S3 method for class 'clm' mellio_payload(x, ..., .call = NULL, conf.int = TRUE, conf.level = 0.95) ## S3 method for class 'TukeyHSD' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'pairwise.htest' mellio_payload(x, ..., .call = NULL, .env = parent.frame()) ## S3 method for class 'dunn_test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'wilcox_test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 't_test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'dunnTest' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'dunn.test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'emmGrid' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'emm_list' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'glht' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'summary.glht' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'medSummary' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'medSummary2' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'modmedSummary' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'modmedSummary2' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'alpha' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'corr.test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'character' mellio_payload(x, title = NULL, ..., .call = NULL) ## S3 method for class 'data.frame' mellio_payload(x, title = NULL, ..., .call = NULL) ## S3 method for class 'survfit' mellio_payload(x, ..., .call = NULL, .env = parent.frame()) ## S3 method for class 'Arima' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'forecast_ARIMA' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'ARIMA' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'ets' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'forecast' mellio_payload(x, ..., .call = NULL) mellio_payload(x, ...) ## S3 method for class 'mellio_payload' mellio_payload(x, ..., .call = NULL) ## Default S3 method: mellio_payload(x, ..., .call = NULL) ## S3 method for class ''NULL'' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'table' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'matrix' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'melliotab' mellio_payload(x, ..., .call = NULL)## S3 method for class 'aov' mellio_payload(x, focal = NULL, controls = NULL, ..., .call = NULL) ## S3 method for class 'summary.aov' mellio_payload( x, focal = NULL, controls = NULL, ..., .call = NULL, .env = parent.frame() ) ## S3 method for class 'aovlist' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'afex_aov' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'anova' mellio_payload(x, focal = NULL, controls = NULL, ..., .call = NULL) ## S3 method for class 'brmsfit' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'stanreg' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'glm' mellio_payload( x, ..., .call = NULL, focal = NULL, controls = NULL, exponentiate = FALSE, conf.int = TRUE, conf.level = 0.95 ) ## S3 method for class 'rlm' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'gam' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'lme' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'glmmTMB' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'kmeans' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'hclust' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'randomForest' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'coxph' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'numeric' mellio_payload(x, name = NULL, ..., .call = NULL) ## S3 method for class 'summaryDefault' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'fa' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'principal' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'factanal' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'prcomp' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'effectsize_table' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'effectsize_difference' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'effectsize_anova' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'see_effectsize_table' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'FitDiff' mellio_payload(x, what = NULL, ..., .call = NULL) ## S3 method for class 'geeglm' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'glmerMod' mellio_payload( x, ..., .call = NULL, exponentiate = FALSE, conf.int = TRUE, conf.level = 0.95 ) ## S3 method for class 'htest' mellio_payload(x, .data = NULL, ..., .call = NULL, .env = parent.frame()) ## S3 method for class 'lavaan' mellio_payload( x, focal = NULL, diagram_omit = NULL, standardized = TRUE, ..., .call = NULL ) ## S3 method for class 'lm' mellio_payload(x, focal = NULL, controls = NULL, ..., .call = NULL) ## S3 method for class 'lmerMod' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'manova' mellio_payload( x, tests = c("Pillai", "Wilks", "Hotelling-Lawley", "Roy"), ..., .call = NULL ) ## S3 method for class 'summary.manova' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'mediate' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'summary.mediate' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'multinom' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'polr' mellio_payload(x, ..., .call = NULL, conf.int = TRUE, conf.level = 0.95) ## S3 method for class 'clm' mellio_payload(x, ..., .call = NULL, conf.int = TRUE, conf.level = 0.95) ## S3 method for class 'TukeyHSD' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'pairwise.htest' mellio_payload(x, ..., .call = NULL, .env = parent.frame()) ## S3 method for class 'dunn_test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'wilcox_test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 't_test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'dunnTest' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'dunn.test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'emmGrid' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'emm_list' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'glht' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'summary.glht' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'medSummary' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'medSummary2' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'modmedSummary' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'modmedSummary2' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'alpha' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'corr.test' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'character' mellio_payload(x, title = NULL, ..., .call = NULL) ## S3 method for class 'data.frame' mellio_payload(x, title = NULL, ..., .call = NULL) ## S3 method for class 'survfit' mellio_payload(x, ..., .call = NULL, .env = parent.frame()) ## S3 method for class 'Arima' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'forecast_ARIMA' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'ARIMA' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'ets' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'forecast' mellio_payload(x, ..., .call = NULL) mellio_payload(x, ...) ## S3 method for class 'mellio_payload' mellio_payload(x, ..., .call = NULL) ## Default S3 method: mellio_payload(x, ..., .call = NULL) ## S3 method for class ''NULL'' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'table' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'matrix' mellio_payload(x, ..., .call = NULL) ## S3 method for class 'melliotab' mellio_payload(x, ..., .call = NULL)
x |
A supported R object. |
focal |
Optional character vector of model terms to mark as the focal predictor(s). Recognised by lm/aov/anova methods. |
controls |
Optional character vector of model terms to mark as controls (vs focal predictors) — recognised by lm/aov/anova methods. |
... |
Additional arguments passed to the dispatched method. |
.call |
Internal — captured user call, used to attribute provenance to the calling script rather than this dispatch. |
.env |
Optional environment used when recovering source variables for supported test objects. |
exponentiate |
Logical. For GLM-style models, exponentiate coefficient estimates (for example, odds ratios in logistic models). |
conf.int |
Logical. Include coefficient confidence intervals when supported by the broom method. |
conf.level |
Confidence level for coefficient intervals. |
name |
Optional name to attach to the payload (used by the numeric/vector descriptive method). |
what |
Optional FitDiff table to extract: |
.data |
Optional data.frame to enrich supported htest results with observed descriptives, effect sizes, and figure data. When omitted, Mellio tries to recover simple source variables from the calling environment before falling back to test-only output. |
diagram_omit |
Optional character vector of parameter keys or
variable names to omit from the generated SEM path diagram while
retaining them in diagram metadata. Use exact path keys like
|
standardized |
Include standardized estimates and standardized-solution metadata when available. |
tests |
Multivariate test statistics to extract (manova method). Defaults to all four classical tests. |
title |
Optional title override (psych/character/data.frame methods). |
Supported in v0: objects of class htest (t.test, cor.test,
wilcox.test, chisq.test, fisher.test).
Schema: see docs/STATS-R-BRIDGE-SCHEMA.md in the repo. The payload
is value-only: numeric statistics, p-values, and CIs go through
unformatted; the Mellio web app applies citation-style rules
(decimals, italics, leading zeros).
A list with class mellio_payload, structured according to
the v0.1 schema.
mellio_open() to open the result in Mellio. mellio_to_json() to
serialise the payload offline.
Other R bridge:
mellio_addin_send(),
mellio_capture(),
mellio_compare(),
mellio_open(),
mellio_to_json(),
print.mellio_payload()
tt <- t.test(extra ~ group, data = sleep) p <- mellio_payload(tt) p$type p$fields$statistictt <- t.test(extra ~ group, data = sleep) p <- mellio_payload(tt) p$type p$fields$statistic
Serialise a Mellio payload to JSON
mellio_to_json(payload, pretty = FALSE)mellio_to_json(payload, pretty = FALSE)
payload |
A |
pretty |
Pretty-print with line breaks (default |
A length-1 character vector containing the JSON.
mellio_payload() to build the payload, mellio_open() to send it
directly to the Mellio web app.
Other R bridge:
mellio_addin_send(),
mellio_capture(),
mellio_compare(),
mellio_open(),
mellio_payload(),
print.mellio_payload()
p <- mellio_payload(t.test(extra ~ group, data = sleep)) cat(mellio_to_json(p, pretty = TRUE))p <- mellio_payload(t.test(extra ~ group, data = sleep)) cat(mellio_to_json(p, pretty = TRUE))
The main entry point for melliotab. Accepts data frames, model objects, or correlation matrices and formats them according to the specified citation style. Passing two or more model objects creates a side-by-side model comparison table.
## S3 method for class 'mediate' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'summary.mediate' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'medSummary' melliotab(x, ..., section = NULL) ## S3 method for class 'medSummary2' melliotab(x, ..., section = NULL) ## S3 method for class 'modmedSummary' melliotab(x, ..., section = NULL) ## S3 method for class 'modmedSummary2' melliotab(x, ..., section = NULL) melliotab(x, ...) ## Default S3 method: melliotab(x, ..., section = NULL) ## S3 method for class ''NULL'' melliotab(x, ...) ## S3 method for class 'character' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'summaryDefault' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'table' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'data.frame' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'lm' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, conf.int = TRUE, conf.level = 0.95, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'glm' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, conf.int = TRUE, exponentiate = FALSE, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'aov' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, effect_size = TRUE, ... ) ## S3 method for class 'htest' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'matrix' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, diagonal = "dash", triangle = "all", ... ) ## S3 method for class 'lavaan' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, what = NULL, section = NULL, standardized = TRUE, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'FitDiff' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, section = NULL, what = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'fa' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, section = NULL, what = NULL, cut = 0, sort = FALSE, decimals = 2L, p_decimals = 3L, ... )## S3 method for class 'mediate' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'summary.mediate' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'medSummary' melliotab(x, ..., section = NULL) ## S3 method for class 'medSummary2' melliotab(x, ..., section = NULL) ## S3 method for class 'modmedSummary' melliotab(x, ..., section = NULL) ## S3 method for class 'modmedSummary2' melliotab(x, ..., section = NULL) melliotab(x, ...) ## Default S3 method: melliotab(x, ..., section = NULL) ## S3 method for class ''NULL'' melliotab(x, ...) ## S3 method for class 'character' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'summaryDefault' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'table' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'data.frame' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'lm' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, conf.int = TRUE, conf.level = 0.95, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'glm' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, conf.int = TRUE, exponentiate = FALSE, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'aov' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, effect_size = TRUE, ... ) ## S3 method for class 'htest' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'matrix' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, decimals = 2L, p_decimals = 3L, diagonal = "dash", triangle = "all", ... ) ## S3 method for class 'lavaan' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, what = NULL, section = NULL, standardized = TRUE, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'FitDiff' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, section = NULL, what = NULL, decimals = 2L, p_decimals = 3L, ... ) ## S3 method for class 'fa' melliotab( x, style = "apa7", title = NULL, number = NULL, note = NULL, source = NULL, section = NULL, what = NULL, cut = 0, sort = FALSE, decimals = 2L, p_decimals = 3L, ... )
x |
A data.frame, model object (lm, glm, aov, htest), or correlation matrix |
style |
Citation style: "apa7" or "ieee" |
title |
Table title |
number |
Table number (integer or character) |
note |
Table note text |
source |
Table source text |
decimals |
Decimal places for estimates/statistics (1-4) |
p_decimals |
Decimal places for p-values (2-4) |
... |
Additional arguments passed to methods |
section |
Optional section selector for multi-section tables. Examples
include |
conf.int |
Include confidence intervals (default TRUE) |
conf.level |
Confidence level (default 0.95) |
exponentiate |
Show exponentiated coefficients (odds ratios for logistic) |
effect_size |
Include effect size (eta-squared) for ANOVA |
diagonal |
Diagonal display: "dash" (em-dash), "one" (keep 1.00), "blank" |
triangle |
Which triangle to show: "all", "lower", "upper" |
what |
Backward-compatible alias for |
standardized |
Include standardized estimates (default TRUE) |
cut |
Minimum absolute loading to display (default 0, show all). Loadings below this threshold are shown as blank cells. |
sort |
Sort items by their primary loading (default FALSE) |
A melliotab object
melliotab() is intended for table output inside R. It supports plain data
frames, matrices, base table objects, correlation matrices, common model
objects, hypothesis-test objects, and payloads created by mellio_payload().
For objects that can produce several tables, call melliotab(x) once to
see the available section choices, then request one explicitly, for
example melliotab(fit, section = "loadings").
The mt_*() helpers are optional table modifiers. They follow the same
pattern as many R table packages: create a table once, then add formatting
only where needed. Common helpers include mt_title(), mt_note(),
mt_decimals(), mt_format_ci(), mt_remove_leading_zeros(),
mt_sig_stars(), mt_spanner(), mt_indent(), and
mt_section_title().
Significance stars are never added by default. Use mt_sig_stars() only
when that convention is appropriate for your manuscript, course, or journal.
# From a data frame df <- data.frame( Variable = c("Age", "Gender"), B = c(0.45, -1.23), SE = c(0.12, 0.34), t = c(3.75, -3.62), p = c(0.0003, 0.0004) ) melliotab(df, style = "apa7", title = "Regression Results") # From a linear model model <- lm(Ozone ~ Temp + Wind, data = airquality) melliotab(model, style = "apa7", title = "Predictors of ozone concentration") # Compare multiple models side by side m1 <- lm(Ozone ~ Temp, data = airquality) m2 <- lm(Ozone ~ Temp + Wind, data = airquality) m3 <- lm(Ozone ~ Temp + Wind + Solar.R, data = airquality) melliotab( m1, m2, m3, labels = c("Step 1", "Step 2", "Step 3"), dep.var.labels = "Ozone concentration" )# From a data frame df <- data.frame( Variable = c("Age", "Gender"), B = c(0.45, -1.23), SE = c(0.12, 0.34), t = c(3.75, -3.62), p = c(0.0003, 0.0004) ) melliotab(df, style = "apa7", title = "Regression Results") # From a linear model model <- lm(Ozone ~ Temp + Wind, data = airquality) melliotab(model, style = "apa7", title = "Predictors of ozone concentration") # Compare multiple models side by side m1 <- lm(Ozone ~ Temp, data = airquality) m2 <- lm(Ozone ~ Temp + Wind, data = airquality) m3 <- lm(Ozone ~ Temp + Wind + Solar.R, data = airquality) melliotab( m1, m2, m3, labels = c("Step 1", "Step 2", "Step 3"), dep.var.labels = "Ozone concentration" )
Convert a melliotab object to a gt table
mt_as_gt(x)mt_as_gt(x)
x |
A melliotab object |
A gt table object
Produces a standalone HTML fragment with the title rendered above the table (outside the gt borders), matching the viewer layout.
mt_as_html(x)mt_as_html(x)
x |
A melliotab object |
Character string of HTML
Convert a melliotab object to LaTeX
mt_as_latex(x)mt_as_latex(x)
x |
A melliotab object |
Character string of LaTeX code
Convert a melliotab object to Markdown
mt_as_markdown(x)mt_as_markdown(x)
x |
A melliotab object |
Character string of Markdown table
Copies the formatted table to the clipboard as rich HTML so it can be pasted into Word with formatting preserved.
mt_copy(x)mt_copy(x)
x |
A melliotab object |
Invisible melliotab object (for piping)
if (interactive()) { model <- lm(mpg ~ wt + hp, data = mtcars) tab <- melliotab(model, title = "Regression Results") mt_copy(tab) # Now paste into Word }if (interactive()) { model <- lm(mpg ~ wt + hp, data = mtcars) tab <- melliotab(model, title = "Regression Results") mt_copy(tab) # Now paste into Word }
Set decimal places
mt_decimals(x, decimals = 2L, p_decimals = 3L)mt_decimals(x, decimals = 2L, p_decimals = 3L)
x |
A melliotab object |
decimals |
Decimal places for estimates/statistics |
p_decimals |
Decimal places for p-values |
Modified melliotab object
Set correlation matrix display options
mt_diagonal( x, mode = c("dash", "one", "blank"), triangle = c("all", "lower", "upper") )mt_diagonal( x, mode = c("dash", "one", "blank"), triangle = c("all", "lower", "upper") )
x |
A melliotab object |
mode |
Diagonal display: "dash", "one", "blank" |
triangle |
Triangle to show: "all", "lower", "upper" |
Modified melliotab object
Format confidence intervals
mt_format_ci(x, decimals = NULL, bracket = TRUE)mt_format_ci(x, decimals = NULL, bracket = TRUE)
x |
A melliotab object |
decimals |
Decimal places for CI values (NULL uses table default) |
bracket |
Whether to use bracket notation |
Modified melliotab object
Indent row labels
mt_indent(x, rows, level = 1L)mt_indent(x, rows, level = 1L)
x |
A melliotab object |
rows |
Row indices to indent |
level |
Indentation level (1-3) |
Modified melliotab object
Set table note
mt_note(x, note)mt_note(x, note)
x |
A melliotab object |
note |
Note text |
Modified melliotab object
Set table number
mt_number(x, number)mt_number(x, number)
x |
A melliotab object |
number |
Table number |
Modified melliotab object
Control leading zero removal
mt_remove_leading_zeros(x, enabled = TRUE)mt_remove_leading_zeros(x, enabled = TRUE)
x |
A melliotab object |
enabled |
Whether to remove leading zeros |
Modified melliotab object
Auto-detects the format from the file extension.
mt_save(x, filename, ...)mt_save(x, filename, ...)
x |
A melliotab object |
filename |
Output file path. Supported extensions: .html, .tex, .md |
... |
Additional arguments passed to format-specific functions |
Invisible file path
model <- lm(mpg ~ wt + hp, data = mtcars) tbl <- melliotab(model, style = "apa7", title = "Results") html_file <- tempfile(fileext = ".html") tex_file <- tempfile(fileext = ".tex") md_file <- tempfile(fileext = ".md") mt_save(tbl, html_file) mt_save(tbl, tex_file) mt_save(tbl, md_file)model <- lm(mpg ~ wt + hp, data = mtcars) tbl <- melliotab(model, style = "apa7", title = "Results") html_file <- tempfile(fileext = ".html") tex_file <- tempfile(fileext = ".tex") md_file <- tempfile(fileext = ".md") mt_save(tbl, html_file) mt_save(tbl, tex_file) mt_save(tbl, md_file)
Add a section title row
mt_section_title(x, label, before = NULL, after = NULL)mt_section_title(x, label, before = NULL, after = NULL)
x |
A melliotab object |
label |
Section title text |
before |
Row index to insert before |
after |
Row index to insert after |
Modified melliotab object
Change the citation style
mt_set_style(x, style = c("apa7", "ieee"))mt_set_style(x, style = c("apa7", "ieee"))
x |
A melliotab object |
style |
Style name: "apa7" or "ieee" |
Modified melliotab object
Add significance stars
mt_sig_stars( x, target = "auto", remove_p = TRUE, levels = c(`*` = 0.05, `**` = 0.01, `***` = 0.001) )mt_sig_stars( x, target = "auto", remove_p = TRUE, levels = c(`*` = 0.05, `**` = 0.01, `***` = 0.001) )
x |
A melliotab object |
target |
Column to add stars to ("auto" to detect) |
remove_p |
Whether to remove the p-value column |
levels |
Named vector of significance thresholds |
Modified melliotab object
Simplify SPSS verbose headers
mt_simplify_headers(x)mt_simplify_headers(x)
x |
A melliotab object |
Modified melliotab object
Set table source
mt_source(x, source)mt_source(x, source)
x |
A melliotab object |
source |
Source text |
Modified melliotab object
Add a spanning column header
mt_spanner(x, label, columns, level = 1L)mt_spanner(x, label, columns, level = 1L)
x |
A melliotab object |
label |
Spanner label text |
columns |
Column indices or names covered by the spanner |
level |
Spanner level (1 = closest to data) |
Modified melliotab object
Set table title
mt_title(x, title)mt_title(x, title)
x |
A melliotab object |
title |
Title text |
Modified melliotab object
Compact summary of a mellio_payload object. Use mellio_to_json() to
see the full structure or str() to inspect the field tree.
## S3 method for class 'mellio_payload' print(x, ...)## S3 method for class 'mellio_payload' print(x, ...)
x |
A |
... |
Unused. |
Invisibly returns x.
Other R bridge:
mellio_addin_send(),
mellio_capture(),
mellio_compare(),
mellio_open(),
mellio_payload(),
mellio_to_json()
Renders the table in the RStudio Viewer pane (or browser).
## S3 method for class 'melliotab' print(x, ...)## S3 method for class 'melliotab' print(x, ...)
x |
A melliotab object |
... |
Ignored |
Invisible melliotab object