---
title: |
    | STAT 408 - Statistical Learning
    | Clustering
date: "April 3, 2018"
output: html_document
---


```{r setup, include=FALSE}
library(ggplot2)
library(dplyr)
library(knitr)
library(randomForest)
library(maps)
library(plotrix)
library(mnormt)
library(rpart)
knitr::opts_chunk$set(echo = TRUE)
knitr::knit_hooks$set(mysize = function(before, options, envir) {
  if (before) 
    return(options$size)
})
```



## Lecture Exercise: Clustering Zoo Animals

Use the dataset create below for the following questions.

```{r, echo=T, mysize=TRUE, size='\\tiny',eval=F}
zoo.data <- read.csv('http://www.math.montana.edu/ahoegh/teaching/stat408/datasets/ZooClean.csv')
rownames(zoo.data) <- zoo.data[,1]
zoo.data <- zoo.data[,-1]
```

- Use multidimensional scaling to visualize the data in two dimensions.


- What are two animals that are very similar and two that are very different?

- Create a hierachical clustering object for this dataset.

Why are a leopard and raccoon clustered together for any cluster size?

- Now add colors corresponding to four different clusters to your MDS plot.

Interpret what each of the four clusters correspond to.