Housekeeping and loading of necessary packages

First, clear out the workspace (after saving any R objects you will need later):

rm(list = ls())

Then, install the required packages:

install.packages("dplyr")install.packages("wakefield")install.packages("sqldf")install.packages("RSQLite")

The convention in this book will be to specify a simple install.packages("packagename") instruction to install the necessary packages, followed by a library("packagename") to load them into memory. Once the required packages are installed, you can either comment them out, or replace the line with conditional installation code:

try(require(dplyr) || install.packages("dplyr"))

But this syntax may not work on all R installations and GUIs, so we will keep ...

Get Practical Predictive Analytics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.