Skip to content

Style guide

John David Smith edited this page Oct 25, 2018 · 8 revisions

List all packages used in the book

The first chapter should have the list of all packages ever referenced in the book

library statements should be at the top of each chapter (file)

Move library(package) to the top of every .Rmd file. Only call packages that are actually used in that chapter.

Fully qualified functions

using the package name as a prefix, which makes it very clear where the function is defined. For example, rather than:

`columns_info_schema_table <- tbl(con, in_schema("information_schema", "columns"))`

use:

`columns_info_schema_table <- dplyr::tbl(con, dbplyr::in_schema("information_schema", "columns"))`

at least for the first couple times that a function appears in the tutorial.

Always reference postgreSQL

We say postgres in conversational settings, but in the book, use the correct name.

Use textboxes, sidebars and footnotes

Help the readers understand new terms, link to definitions, etc. Can be highlighted with text color or with an box HTML like:

Important message or point

Making chapters free-standing

Dependencies and initialization need to be very clear.

Watch for long series of pipes

Consider memory issues implied by many pipes

Code readability

Watch for line length and indentation

Stick to dvdrental and ANSI standard tables

Avoid using postgreSQL-specific tables so that any code / learning in the tutorial is transferable to other databases.

Clone this wiki locally