In this set of exercises we will use lattice package. Firstly, we have to install this package with command ` install.packages("lattice") `

and then we will call it ` library(lattice) `

. Lattice package permits us to create univariate, bivariate and trivariate plots. For this set of exercises we will see trivariate plots. We will use a dataset example that we have to download from here here.

Answers to the exercises are available here.

If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page.

**Exercise 1**

For first exercise, create a level plot formula for matches won against an interaction between goals done and goals received per team

**Exercise 2**

Now, use the same formula of the previous exercise in a countourplot. Try difference between region option

**Exercise 3**

Now, produce a cloud plot of number of injuries againts an interaction between goals received and goals done

**Exercise 4**

Using the same formula of the previous exercise, produce a wireframe plot

**Exercise 5**

For the previous exercises we used formula plot. Now try to produce a levelplot matrix using a matrix of goals done goals received and number of injuries

**Exercise 6**

Using the same matrix produced previously, create a contour plot matrix

**Exercise 7**

Now, create a cloud matrix plot

**Exercise 8**

Finally, produce a wireframe matrix plot using the matrix created in exercise 5.

**What's next:**

- Explore all our (>1000) R exercises
- Find an R course using our R Course Finder directory
- Subscribe to receive weekly updates and bonus sets by email
- Share with your friends and colleagues using the buttons below

## Leave a Reply