MTHM501 Formative Coursework 2
Visualisation
Load the Animals.csv file from ELE. This consists of a datafile with three variables, ¡°x¡±, ¡°y¡± and ¡°z¡± and 3,026 observations (rows). ¡°x¡± records weight in kilogrammes, ¡°y¡± records height in metres and ¡°z¡± records species. You should
1. Load the file into RStudio
2. Rename (use the “rename” function) the “x” variable to “Weight”, the “y” variable to “Height” and the “z” variable “Species”.
3. Rename the levels of “Species”: a=Ostrich, b=Deer, c= Bear, d= Giant tortoise (use the “factor” function to reset the labels).
4. Use “mutate” to create a new variable called BMI (BMI is calculated as weight in kilogrammes divided by height in metres squared).
5. Create a scatter plot to explore the relationship between Height and Weight. What do you conclude about this relationship?
6. Create a scatter plot to explore the relationship between Height and Weight split by species (use facetting). What do you conclude about this relationship?
7. Use an appropriate graph to explore the BMI of the different species types.
Your report should consist of the annotated code you used and your plots and interpretations from parts 5,6 and 7.
CS Help, Email: tutorcs@163.com