New export_milestones_yaml() writes the whole Milestones database to plain-text YAML files: one file per milestone (milestones/<slug>.yaml), plus authors.yaml, references.yaml and vocabulary.yaml (aspects, subjects, keywords). Within a milestone file, authors, references and keywords are given by name or key rather than integer id, so the files are easy to edit and to keep under version control.
New read_milestones_yaml() reads such a folder back into the package’s tables, checking that every author, reference, keyword, aspect and subject that a milestone names exists. Reading back the export reproduces all 12 tables (checked in dev/check-yaml-roundtrip.R).
All 297 milestones are exported to data-raw/yaml/ (by data-raw/export-yaml.R). These files are intended to become the editable source of the package data, replacing the MySQL database at datavis.ca.
The export also cleans up some problems in the data: duplicate rows in the link tables (4 in milestone2keyword, 2 in milestone2reference), links to authors not in author (aid 1 = “Unknown”, and a deleted aid 45), the aspect/subject 0 placeholder for one milestone, a duplicated bibtexkey (Ocagne:1885), CRLF line endings, and the MySQL “zero date” 0000-00-00.
yaml is now imported.
Fixed: after library(milestoneR), accessor functions such as milestone(), aspect(), keyword(), reference() and mediaitem() failed with “could not find function”, because the lazy-loaded datasets of the same names masked them. LazyData is now false. The accessors load their data themselves, so get the data with milestone() etc. (or data(milestone, package = "milestoneR")).
Examples use base R (subset(), split()) instead of dplyr. The authors(), keyword() and milestone() examples are no longer wrapped in \dontrun{}, so R CMD check now runs them. R CMD check is clean (0 errors, warnings and notes).
TODO: read additions/edits from a simple tagged-text format (as in statquotes), e.g. read_milestones_txt().
Version 0.3.0
Re-design to use the .csv files from the Milestones Project database directly in the package, rather than using any DBI stuff
Fixed HTML entities to use latin1 / utf8 encoding in the Milestones .RData files.
Added missing aspect/subject/keyword datasets
All data tables now available via accessor functions like authors(), milestone()
Added print_reference(), print_author()` w/ output to text, html, markdown, bibtex