Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "we will employ some methods from the forecast
package"
A block of R code (usually a function's body) is set as follows:
logreturn <- function(x) { log(tail(x, -1) / head(x, -1)) }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
logreturn <- function(x) {
log(tail(x, -1) / head(x, -1))
}
Any command-line input or output is written as follows:
> pi [1] 3.141593
Where ">
" shows that the R console is waiting for commands to be evaluated. Multiline expressions are started with the same symbol on the first line, but all the rest lines have a "+
" sign at the beginning to show that the last R expression is still to be finished.
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "clicking the Next button moves you to the next screen".