Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “We use the lm
function for our outcome model as before but will adjust how we calculate the standard errors using the sandwich
package.”
A block of code is set as follows:
library(MASS) set.seed(123) ad_data <- data.frame(ad_spend = runif(100, 100, 1000), sign_ups = rpois(100, lambda=20)) # Poisson regression model model <- glm(sign_ups ~ ad_spend, data=ad_data, family="poisson") summary(model)
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
x <- c(1, 2, 3) factor_x <- structure(x, class = "factor", .Label = c("low", "medium", "high"))
Bold: Indicates a new term, an important word, or words that you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Found at the top left (accessible via File | New File | R Script), this is where you write and save longer code blocks or scripts for complex analyses.”
Tips or important notes
Appear like this.