Created
December 12, 2012 13:05
-
-
Save josefslerka/4267584 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
tbl <- read.csv("kv.csv", header=TRUE) | |
tbl <- subset(tbl, select = -X ) | |
d <- dist(tbl) | |
fit <- cmdscale(d,eig=TRUE, k=2) | |
nazev <- c("Fischer", "Sobotka", "Franz", "Roithová", "Fischerová", "Dientsbier", "Schwarzenberg","Zeman") | |
x <- fit$points[,1]*(-1) | |
y <- fit$points[,2] | |
plot(x, y, xlab="levice - pravice", ylab="konzervativni - liberalni", | |
main="Podobnost kandidátů podle postojů", type="n", ylim=c(-6,6), xlim=c(-6,6)) | |
text(x, y, labels = nazev) | |
abline(h=0, v=0, col = "gray60") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment