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.
For first exercise, create a level plot formula for matches won against an interaction between goals done and goals received per team
Now, use the same formula of the previous exercise in a countourplot. Try difference between region option
Now, produce a cloud plot of number of injuries againts an interaction between goals received and goals done
Using the same formula of the previous exercise, produce a wireframe plot
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
Using the same matrix produced previously, create a contour plot matrix
Now, create a cloud matrix plot
Finally, produce a wireframe matrix plot using the matrix created in exercise 5.
- Become a Top R Programmer Fast with our Individual Coaching Program
- Explore all our (>4000) 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