Data Science Desktop Survival Guide
by Graham Williams
#to introduce ordinary comments and separate comments from code with a single empty line before and after the comment. Comments should be full sentences beginning with a capital and ending with a full stop.
# How many locations are represented in the dataset.
ds$location %>% unique() %>% length()
# Identify variables that have a single value.
sapply(function(x) all(x == x[1L])) %>%
Sections might begin with all uppercase titles and subsections with initial capital titles. The last four dashes at the end of the comment are a section marker supported by . Other conventions are available for structuring a document and different environments support different conventions.
# DATA WRANGLING —-
# Normalise Variable Names —-
# Review the names of the dataset columns.
# Normalise variable names and confirm they are as expected.
ds %<>% dplyr::rename_all(rattle::normVarNames)
# Wrangle weatherAUS —-
# Convert the character variable 'date' to a Date data type.