Lezione 1 %Inserire un file dati, es. indicatori_benessere.txt, in una propria cartella. %Da R, cambiare directory portandosi in quella cartella. %Caricare il file col comando: IB<-read.table(file="indicatori_benessere.txt",header=TRUE) IB %Analisi unidimensionale IB.1 <- IB[,1] plot(IB.1) hist(IB.1) ... IB.5 <- IB[,5] plot(IB.5) hist(IB.5) %Analisi multidimensionale pca<-princomp(IB) biplot(pca) require(cluster) clust3 <- pam(IB, 3) ----------------------- %Comandi non usati ma collegati: Q=cov(IB) filled.contour(Q, color = terrain.colors, plot.title = title(main = "Correlation Matrix", xlab = "indicatore", ylab = "indicatore"), plot.axes = { axis(1, seq(1, 15, by = 5)) axis(2, seq(1, 15, by = 5)) }, key.title = title(main="covar"), key.axes = axis(4, seq(-1, 1, by = 0.2))) plot(clust3) clust4 <- pam(IB, 4) plot(clust4)