Guide for creating DAAF agent definition files. Covers 12-section template, hook registration, skills-in-frontmatter, integration checklist. Use when adding or revising agents. For SKILL.md files, use skill-authoring instead.
中文简介正在准备中。当前显示原文说明。
R table formatting with gt, kableExtra, modelsummary. Publication-quality tables: gt() grammar-of-tables, fmt_*() formatting, tab_*() structure, gtsave() export. Use when execution language is R. Python equivalent: great-tables (use when execution language is Python).
中文简介正在准备中。当前显示原文说明。
实测评分 未实测
查看安装方法安装前可以查看交给 AI 代理的指令内容。
R table formatting ecosystem for publication-quality tables. Covers gt 1.3.0 for
grammar-of-tables construction (gt(), fmt_() number formatting, tab_() structure,
cols_*() column operations, gtsave() export), kableExtra 1.4.0 for knitr/kable
HTML and LaTeX table styling in Quarto documents, and modelsummary 2.6.0 for
formatting regression output from lm/glm/fixest/plm models into publication tables.
Use when execution language is R and the task involves creating formatted data
tables, summary tables, or regression tables for reports or papers. Python
counterpart: the great-tables skill (same author, same grammar of tables) —
use it when execution language is Python. For visualization (charts/plots), use
ggplot2 instead. For document structure and rendering, use quarto instead.
gt implements a grammar of tables for R, analogous to ggplot2's grammar of graphics but for tabular output:
|> (data frame in, gt table out)kableExtra extends knitr's kable() for HTML and LaTeX table styling:
modelsummary formats regression output into publication-ready tables:
vcov argument (no re-fitting needed)reporting.md) and referenced
by fixest -- this skill provides the table-formatting perspectivefmt_*() family for
number formatting, tab_*() for structural elements, cols_*() for column
operations, opt_*() for table options.kbl() replaces knitr::kable() as the
recommended entry point. Full HTML and LaTeX styling support.output = "gt". See r-stats skill reporting.md for
comprehensive modelsummary coverage.kable() function that kableExtra
extends.| File | Purpose | When to Read |
|---|---|---|
quickstart.md | Basic gt() table, headers/footers/source notes, simple formatting | Starting out or need a quick table |
formatting.md | fmt_*() family, conditional styling, spanners, row groups, summary rows | Detailed formatting and structure |
modelsummary-tables.md | Regression tables via modelsummary(), customization, multi-model comparison | Formatting regression output |
export.md | gtsave(), kableExtra in Quarto, inline tables in .qmd, output formats | Saving or embedding tables |
quickstart.mdformatting.mdmodelsummary-tables.mdexport.mdexport.md (kableExtra section)| Skill | Relationship |
|---|---|
ggplot2 | Visualization (charts/plots) -- use ggplot2 for figures, gt for tables |
quarto | Document rendering -- gt/kableExtra tables render in .qmd documents |
fixest | Regression output -- fixest models feed into modelsummary/gt tables. fixest's own etable() is an alternative to modelsummary for fixest-only output |
r-stats | Regression output -- lm/glm models feed into modelsummary/gt tables. r-stats reporting.md has comprehensive modelsummary coverage |
plm | Panel model output -- plm models feed into modelsummary/gt tables |
data-scientist | Methodology guidance for what to present in tables |
Python counterpart: Use the great-tables skill for Python table
formatting. The great-tables package (version 0.21.0, by the same author as
gt, implementing the same grammar of tables) is DAAF's Python table-formatting
tool — load that skill when execution language is Python. Note surface
differences from gt: method chaining instead of |>, 0-based cols_merge
pattern indices, Polars expressions in grand_summary_rows, and HTML/LaTeX
export in-process (but no working PNG export in the container). For regression
tables in Python, great-tables has no modelsummary equivalent — use pyfixest's
etable() or statsmodels' summary().
What kind of table?
+-- Data summary table (descriptive stats, crosstabs)
| +-- Simple (few rows/columns, minimal formatting)
| | +-- In a Quarto doc? --> kableExtra kbl() in ./references/export.md
| | +-- Standalone? --> gt() in ./references/quickstart.md
| +-- Complex (conditional formatting, row groups, summary rows)
| +-- gt() in ./references/formatting.md
+-- Regression table (model coefficients)
| +-- Single model --> ./references/modelsummary-tables.md
| +-- Multiple models side-by-side --> ./references/modelsummary-tables.md
| +-- fixest models only --> Consider fixest etable() (see fixest skill)
| OR modelsummary() for more customization
+-- Frequency / cross-tabulation table
| +-- gt() with row groups --> ./references/formatting.md
+-- Table with color scales or conditional formatting
+-- gt tab_style() or data_color() --> ./references/formatting.md
Choosing a table package?
+-- Publication-quality data table with rich formatting
| +-- gt() (most flexible, best output quality)
+-- Regression table (multiple models, SEs, goodness-of-fit)
| +-- modelsummary() (purpose-built for this)
+-- Simple table in a Quarto document
| +-- kableExtra kbl() (lightweight, integrates with knitr)
+-- Quick console output (not for publication)
| +-- print() or knitr::kable() (no extra packages needed)
+-- LaTeX table for a journal submission
+-- gt() with gtsave("file.tex") OR modelsummary(output = "latex")
In DAAF research pipelines, tables are generated through script files in
scripts/stage8_analysis/, not interactively. This ensures auditability and
reproducibility.
The pattern:
scripts/stage8_analysis/{step}_{table-name}.Rbash {BASE_DIR}/scripts/run_with_capture.sh {script_path}gtsave() to save tables to the project output directorySee agent_reference/SCRIPT_EXECUTION_REFERENCE.md for the mandatory file-first
execution protocol.
library(gt)
library(kableExtra)
library(modelsummary)
tbl <- df |>
gt() |>
tab_header(
title = "Table Title",
subtitle = "Subtitle or description"
) |>
tab_source_note("Source: Dataset name, year.") |>
fmt_number(columns = where(is.numeric), decimals = 2)
| Operation | Code |
|---|---|
| Create table | gt(df) or `df |
| Title/subtitle | tab_header(title, subtitle) |
| Source note | tab_source_note("Source: ...") |
| Footnote | tab_footnote(footnote, locations) |
| Format numbers | fmt_number(columns, decimals) |
| Format percent | fmt_percent(columns, decimals) |
| Format currency | fmt_currency(columns, currency) |
| Format date | fmt_date(columns, date_style) |
| Column spanner | tab_spanner(label, columns) |
| Row group | gt(groupname_col = "group_var") |
| Summary row | summary_rows(groups, fns, columns) |
| Conditional style | tab_style(style, locations) |
| Column labels | cols_label(col1 = "Label 1") |
| Hide columns | cols_hide(columns) |
| Column width | cols_width(col1 ~ px(150)) |
| Save | gtsave(tbl, "file.html") |
df |>
kbl(format = "html", digits = 2, caption = "Table Title") |>
kable_styling(bootstrap_options = c("striped", "hover", "condensed")) |>
add_header_above(c(" " = 1, "Group A" = 2, "Group B" = 2))
modelsummary(
list("Model 1" = fit1, "Model 2" = fit2),
stars = c("*" = 0.05, "**" = 0.01, "***" = 0.001),
coef_rename = c("x1" = "Education", "x2" = "Experience"),
gof_map = c("nobs", "r.squared", "adj.r.squared"),
output = "gt"
)
| Topic | Reference File |
|---|---|
| Basic gt table creation | ./references/quickstart.md |
| tab_header, tab_source_note | ./references/quickstart.md |
| tab_footnote | ./references/quickstart.md |
| Simple number formatting | ./references/quickstart.md |
| cols_label column renaming | ./references/quickstart.md |
| fmt_number, fmt_percent, fmt_currency | ./references/formatting.md |
| fmt_date, fmt_integer | ./references/formatting.md |
| Conditional formatting (tab_style) | ./references/formatting.md |
| Color scales (data_color) | ./references/formatting.md |
| Column spanners (tab_spanner) | ./references/formatting.md |
| Row groups | ./references/formatting.md |
| Summary rows | ./references/formatting.md |
| Grand summary | ./references/formatting.md |
| Column width and alignment | ./references/formatting.md |
| Merge cells | ./references/formatting.md |
| modelsummary basic usage | ./references/modelsummary-tables.md |
| Multi-model comparison | ./references/modelsummary-tables.md |
| Coefficient renaming and omission | ./references/modelsummary-tables.md |
| Custom statistics rows | ./references/modelsummary-tables.md |
| Robust/clustered SEs in tables | ./references/modelsummary-tables.md |
| fixest models in modelsummary | ./references/modelsummary-tables.md |
| Stars and significance formatting | ./references/modelsummary-tables.md |
| gtsave to HTML/PNG/LaTeX | ./references/export.md |
| kableExtra in Quarto | ./references/export.md |
| Inline tables in .qmd | ./references/export.md |
| Output format comparison | ./references/export.md |
When gt is used as a primary table-formatting tool, include in the report's Software & Tools references:
Iannone, R., Cheng, J., Schloerke, B., Hughes, E., Lauer, A., & Seo, J. (2024). gt: Easily Create Presentation-Ready Display Tables. R package version 1.3.0. https://gt.rstudio.com/
Cite when: gt produces tables included in the report or deliverables. Do not cite when: Only used for quick exploratory tables not included in deliverables.
For modelsummary citation (when used for regression tables):
Arel-Bundock, V. (2022). "modelsummary: Data and Model Summaries in R." Journal of Statistical Software, 103(1), 1-23.
For kableExtra citation (when used for Quarto table styling):
Zhu, H. (2024). kableExtra: Construct Complex Table with kable and Pipe Syntax. R package version 1.4.0.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Guide for creating DAAF agent definition files. Covers 12-section template, hook registration, skills-in-frontmatter, integration checklist. Use when adding or revising agents. For SKILL.md files, use skill-authoring instead.
中文简介正在准备中。当前显示原文说明。
Researcher-facing analytic triangulation ("creative verification") for stress-testing provisional findings and designing pre-specified challenges before an analysis runs. Turns a researcher's concern or focal claim into competing explanations, bounded discriminating tests, audited diagnostic artifacts, and evidence-calibrated interpretations in a hypothesis/evidence ledger — behavioral, output-level verification replacing line-by-line code review. Covers 12 challenge families organized by Shadish-Cook-Campbell validity type, named sensitivity statistics, pre-committed interpretation rules, anti-fishing guardrails, and interactive diagnostic-artifact QA. Use in Ad Hoc Collaboration to verify, challenge, or stress-test a result, or to design discriminating tests before an analysis runs. Not code-change verification (verify skill / code review) and not final adjudication or re-execution (data-verifier, Reproducibility Verification) — prospective, hypothesis-driven challenge design of analytic claims.
中文简介正在准备中。当前显示原文说明。
In-situ smoke testing that verifies a LIVE DAAF deployment functions end-to-end in whatever provider route it is configured for. Auto-detects the active install route (anthropic-subscription, openrouter, chatgpt-subscription shim, openai-api shim) and runs tiered probes: Tier 0 free preflight (route/env coherence, hooks, statuslines, shim health); Tier 1 one live round-trip (~cents); Tier 2 a six-probe functional battery (dispatch, coding, web, skill loading, isolation-strip, nested-dispatch deny); Tier D a zero-cost deterministic battery (bats, Pester, lint, safety-hook tests). Use after install, after a rebuild or update, after any provider/config change (new API key, model remap, shim change), for pre-release validation, or when asked "is my install working" or to "smoke test the deployment/config." Requires the DAAF_DEV=1 dev image; a contributor tool, not end-user-facing. NOT DAAFBench (model behavioral-adherence evaluation under benchmarks/) and NOT scripts/smoke_tests/ (R/Python library-package smoke tests).
中文简介正在准备中。当前显示原文说明。
Operational framework for the DAAF orchestrator. Defines engagement modes, confirmation protocol, subagent dispatch, context budget, and reference-loading. Loaded exclusively by the orchestrator — not for subagents or user questions.
中文简介正在准备中。当前显示原文说明。
Data science methodology and method-selection routing for quantitative research. Covers EDA, data validation, descriptive analysis, causal inference (IV, DiD, RD, synthetic control), clustering/PCA/UMAP, supervised ML, geospatial analysis, network analysis, and visualization design. Contains the canonical method-to-library routing tree, routed by execution language — Python: statsmodels (OLS/GLM/time series), pyfixest (FE/DiD), linearmodels (RE/GMM/SUR), svy (complex surveys), scikit-learn (clustering/prediction ML), geopandas (spatial), igraph (network analysis); R: r-stats (OLS/GLM/time series), fixest (FE/DiD), plm (panel/RE/IV), survey-r (complex surveys), tidymodels (ML), sf-terra (spatial), igraph-r (network analysis). Load the routed tool-specific skill before giving tool-specific advice or writing code — library skills encode environment constraints and curated caveats absent from general knowledge.
中文简介正在准备中。当前显示原文说明。
Interpretation guidance for Urban Institute Education Data Portal datasets. The Portal is a curation layer over federal data: lowercase variable names, integer-encoded categoricals, standardized missing codes (-1 missing, -2 not applicable, -3 suppressed). Covers year definitions, grade encoding (grade=-1 is Pre-K, not missing), suppression rates, ODC-By licensing, and cross-source join identifiers. Load before analyzing any Portal data. Routes to source-specific deep-dive skills for individual datasets.
中文简介正在准备中。当前显示原文说明。