Module 2: APA Tables

Automating the Mundane with Flextable

Author

A. C. Del Re

The Problem with Tables

Formatting APA tables in Word is painful. * “Times New Roman, 12pt” * “No vertical lines.” * “Horizontal lines only at the top, bottom, and under headers.”

If you do this by hand, you have to redo it every time your N changes.

The Solution: flextable

The flextable package is the engine that drives modern reproducible reporting. It exports native Word tables that look perfect.

1. Setup (Re-Loading Data)

2. Table 1: Demographics

We want a table showing Mean (SD) for continuous variables and N (%) for categorical ones.

3. The Correlation Matrix

Psychologists love correlation tables. Let’s make one that flags significance automatically.

Note on Tables

We use results: asis and HTML conversion to show you the crisp, styled table right here in the browser.



Next Module: Visualization >