Appendix A. Exercises and Solutions


Here, we provide the exercises for most chapters and recommend that you practice your newly acquired skills after reading each chapter.

Chapter 1 – Setting GNU R for Predictive Modeling

Chapter 1 already contains the exercises and solutions.

Chapter 2 – Visualizing and Manipulating Data Using R

Have a look at the following exercises and try to perform the required tasks.

Let's have a little fun now! For this exercise, imagine a player betting on red for 1,000 consecutive trials. You'll have to plot the variations in money throughout the game. Use the isRed attribute of the data frame Data that we built at the beginning of the chapter. The player here starts with $1,000 and bets 1 in every game. The worst ...

Get R: Predictive Analysis now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.