a11ytables
a11ytables copied to clipboard
YAML for table specification
Consider using YAML files to guide table construction.
title: The 'mtcars' Demo Dataset
description: >
Aspects of automobile design and performance.
properties: >
Suppressed values are replaced with the value ['c'].
Blank cells in the 'Notes' column indicate the absence of a note.
contact: >
The mtcars Team, telephone: 012 3456 789
tables:
- name: Table 1
title: Car Road Tests 1
source: Motor Trend (1974)
file: table1.csv
- name: Table 2
title: Car Road Tests 2
source: Motor Trend (1974)
file: table2.csv
notes:
- number: 1
description: US gallons
- number: 2
description: >
Retained to enable comparisons with previous analyses.
Processing steps:
- The cover page can be generated from the head elements,
title
,description
,properties
,contact
. - The contents can be generated from the information in the tables list (using the
name
andtitle
components) and the existence (or otherwise) of the notes list. - The notes list can be coerced into a table.
- The
file
property of a tables list gives the file that the tables come from, if preferable you can have function to read and check these conform, potentially only allow specific formats (e.g. only CSV/RDS).
yaml::read_yaml()
will read a YAML file and return an R list.