ABSTRACT

This chapter teaches the building blocks of reproducible code. It also introduces low-level geometric algorithms. The chapter covers scripts that are the basis of reproducible R code and explains that algorithms are recipes for modifying inputs using a series of steps, resulting in an output. If functions distributed in packages are the building blocks of R code, scripts are the glue that holds them together, in a logical order, to create reproducible workflows. To programming novices scripts may sound intimidating but they are simply plain text files, typically saved with an extension representing the language they contain. R scripts are generally saved with a.R extension and named to reflect what they do. Algorithms can be understood as the computing equivalent of a cooking recipe. They are a complete set of instructions which, when undertaken on the input (ingredients), result in useful (tasty) outputs. Like algorithms, functions take an input and return an output.