set.seed(1234)
randDat<-matrix(rnorm(50), nrow=5)
x<-seq(-10, 10, by =.1)
y<-dnorm(x, mean=2.5, sd=0.5)
plot(x,y)
dist(randDat) #Euclidian Distance default
## 1 2 3 4
## 2 4.261667
## 3 4.038030 2.060117
## 4 3.456732 3.726399 4.037978
## 5 5.307253 4.415046 4.111230 4.814393
dist(randDat, method="manhattan")
## 1 2 3 4
## 2 11.382197
## 3 10.016795 4.536827
## 4 9.887932 8.845512 8.829131
## 5 14.683770 10.617871 9.091241 11.362705
dist(randDat, method="minkowski", p=4)
## 1 2 3 4
## 2 2.899494
## 3 2.875467 1.653824
## 4 2.208297 2.814135 3.453336
## 5 3.488531 3.192217 3.398721 3.643788
## Iris Dataset analysis with multiple clustering ##algorithms
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.