1.5 The Importance of Being Precise

It’s important to be careful and precise with the commands you type. Small changes in punctuation and spelling can lead to errors of many kinds; some errors you’ll see immediately because your code won’t run, other errors can be more subtle – the code will run but you won’t get the result you intended.

For example:

In this tutorial and the lab assignments we will often be using functions from the tidyverse packages. This is a set of packages that simplify working with (or wrangling) data in R. (You can find out more about the tidyverse here).

To read a csv file into R using tidyverse, the function is read_csv To do the same thing in base R, the function is read.csv. Both work, but they have different functionality, so different arguments, and the object they create from the data once it is read in to R has different properties. So a small change (read_csv instead of read.csv) has important consequences.