
i
i
“K23166” — 2015/1/28 — 9:35 — page 216 — #242
i
i
i
i
i
i
216 APPENDIX A. INTRODUCTION TO R AND RSTUDIO
session in Figure A.4 can be executed by running the following command.
> source("http://www.amherst.edu/~nhorton/r2/examples/sampsess.R",
echo=TRUE)
Most of the examples at the end of each chapter can be executed by running the command:
> source("http://www.amherst.edu/~nhorton/r2/examples/chapterXX.R",
echo=TRUE)
where XX is replaced by the desired chapter number. In many cases, add-on packages (see
A.6.1) need to be installed prior to running the examples. To facilitate this process, we
have created a script file to load them in one step.
> source("http://www.amherst.edu/~nhorton/r2/examples/install.R", ...