# SPIDA 2010: Mixed Models with R: Installing spida and p3d packages

### From MathWiki

Home page for course: SPIDA 2010: Mixed Models with R

Mixed Models with R in SPIDA 2010 uses two local R packages that are under development:

- spida package: mixed model tools -- in development
- p3d package: 3d data and model displays -- in development

For installation, follow the instructions below.

Table of contents |

## Installation

### From R-Forge

The 'spida' and 'p3d' packages are on R-Forge. To install both packages, first install 'car' and 'rgl' from CRAN as follows:

> install.packages( c("car","rgl"))

Then install 'spida', and 'p3d' from R-Forge with

> install.packages( c("spida","p3d"), repos = "http://R-Forge.R-project.org")

To use 'spida' or 'p3d' in a session, use the 'library' function:

> library(spida) > library(p3d)

The methods below are needed only if an important change to the 'local' package has not yet found its way into the compiled package on R-Forge. There can be a delay of as much as one day between uploading a local correction to a package and its availability through R-Forge.

### Using Windows in the TEL lab

Installation can be done a number of ways. The following is relatively simple.

- Start R.
- Give the command:

> setwd("F:/")

- Use the following R commands:

> download.file("http://www.math.yorku.ca/~georges/R/spida.zip", "spida.zip") > download.file("http://www.math.yorku.ca/~georges/R/p3d.zip", "p3d.zip")

- This only needs to be done the first time you use the lab.

- It may or may not be necessary to do the following each time you log in to Windows in the lab: Start R and give the command:

> setwd("F:/") # not necessary if you are already there

- In the toolbar of the R window: Click on 'Packages|Install package{s} from local zip files'
- Use Ctrl-LeftMouseButton to select both 'spida.zip' and 'p3d.zip'

- At each new R session

- Use the commands:

> library(spida) > library(p3d)

### Using Windows on a personal PC

- Verify that you are connected to the internet.
- Start R.
- Use the following commands:

> download.file("http://www.math.yorku.ca/~georges/R/spida.zip", "spida.zip") > download.file("http://www.math.yorku.ca/~georges/R/p3d.zip", "p3d.zip")

- In the toolbar of the R window: Click on 'Packages'|Install package{s} from local zip files
- Use Ctrl-LeftMouseButton to select both 'spida.zip' and 'p3d.zip'

- The preceding only needs to be done the first time you want to use the packages and subsequently whenever you wish to update to a newer version.

- At each new R session

- Use the commands:

> library(spida) > library(p3d)

plus any other packages you wish to load.

### Mac (help: PLEASE COMPLETE)

Please add instructions for the Mac.

The relevant files are:

> download.file("http://www.math.yorku.ca/~georges/R/spida.tar.gz", "spida.tar.gz") > download.file("http://www.math.yorku.ca/~georges/R/p3d.tar.gz", "p3d.tar.gz")