Chapter 1 About

This book is intended to serve as a guide for the R functions you will be running in PSYC 605. The statistics will be covered in class; this is to support your analysis using R. This is not intended to be an exhaustive guide to R but rather a tool to aid in your work.

For clarity’s sake, repeated tests between statistical techniques will be fully explained each time to prevent needing to reference prior chapters. For example, tests of normality will be fully explained for different t-tests and ANOVAs. This may be repetitive, but it also allows each chapter to be fully stand-alone.

1.1 What different things mean

When there is text typed like this, it is informational or descriptive, telling you how to do something.

Text that appears to be highlighted in grey, such as the function mean(cars$cyl), is R code. This is used when referencing a specific function or portion of code.

You will also find longer bits of code that are set in to the main text, as below:

#Here is a comment in the code
#And below is code
cars <- mtcars

This offset code will often come with output below it, to allow you to see both the code and what, if anything, it generates. It will also be commented, as an example of best practice and to aid in explanation.

NOTE: While it is best practice in code to load all necessary packages at the start of the script, I will be loading in packages as we use them to illustrate what functionality we are using. I will, however, name all the packages we use in a particular chapter up front. Further, I do not include install.packages() for every package that is used. If you don’t have the package, install it first.

1.2 Additional resources

Creation of this guide would not have been possible without the numerous R packages listed. Additionally, the following guides and open resources contributed to the completion of this guide, and are great resources to have available for further reference: