nlme
packagenlme
packageThere’s a few packages we’ll need for the rest of the workshop. So, for this exercise, use the “install packages” button in the Rstudio package tab to install the following packages:
lsr
: Companion to “Learning Statistics with R”, written by Dan Navarropsych
: Psychometrics and Personality functions, written by William Revellecar
: “Companion to Applied Regression”, written by John FoxIt’s worth installing the ez
package too: we won’t use it for the exercises, but it’s a good package for repeated measures ANOVA, and I do talk about it later on.
The data set that we’ll use for the exercise is located online at
Open a browser, go to that address and save the file to disk. In my case, I saved it to
~/Work/Research/Rbook/workshop_dsto/datasets/driving.Rdata
where ~
is a standard symbol used in Unix-like operating systems such as Mac OS X that refers to “the current user’s home directory”, which for my current machine would be /Users/dan
. I mention this because you’ll sometimes see R refer to the ~
directory, and you might want to know what it means.
In any case, once you’ve saved the file to disk somewhere, use the load button in the Rstudio workspace tab to open it. You’ll see that there’s only one variable there, a data frame called driving
.
Create a few new variables, and then use the save button in the Rstudio workspace tab to save it to disk. Don’t overwrite the existing driving.Rdata
file: call it something like driving_version2.Rdata
or something. I generally find that it’s a good idea to leave the original data file in pristine condition.
There is a CSV version of the driving data frame located at
Save it to disk, and import the data using the “import dataset” menu in the Rstudio workspace tab.
newscript.R
)