This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#成績データの入力 | |
seiseki<-matrix(c(89,90,67,46,50,57,70,80,85,90,80,90,35,40,50,40,60,50,45,55,78,85,45,55,60,55,65,80,75,85,90,85,88,92,95),7,5,byrow=TRUE) | |
colnames(seiseki)<-c("算数","理科","国語","英語","社会") | |
rownames(seiseki)<-c("田中","佐藤","鈴木","本田","川端","吉野","斎藤") | |
#ユークリッド距離を求める。distは、成績のユークリッド距離を求めている。 | |
seiseki.d<-dist(seiseki) | |
#小数点以下を丸める | |
round(seiseki.d) |