November 2016
Beginner to intermediate
959 pages
43h 46m
English
Some R functions can operate on vectors as a whole. The function can either be a built-in R function or a custom function. In your own code, before you resort to a loop to process all elements of a vector, see whether you can exploit an existing vectorized function.
If you have not already downloaded the files for this chapter, do it now and ensure that the auto-mpg.csv file is in your R working directory.
To exploit vectorized operations follow these steps:
> first.name <- c("John", "Jane", "Tom", "Zach") > last.name <- c("Doe", "Smith", "Glock", "Green") > # The paste function below operates on vectors ...Read now
Unlock full access