Last active
April 25, 2016 15:56
-
-
Save tukachev/cf7448c653a47cb0fd3ec4fb9d877718 to your computer and use it in GitHub Desktop.
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
p.disagreement <- function(data) { | |
n <- ncol(data) | |
m <- matrix(0, n, n) | |
rownames(m) <- names(data) | |
colnames(m) <- names(data) | |
for (i in 1:n) { | |
for (j in i:n) { | |
m[i, j] <- mean(data[, i] != data[, j]) | |
} | |
} | |
m[lower.tri(m)] <- t(m)[lower.tri(m)] | |
as.dist(m) | |
} | |
metafor <- read.delim("~/Tsvetovye_metafory_gumanitariev.csv") | |
mat <- p.disagreement(metafor) #Матрица процент несогласия | |
fit <- hclust(mat, method = "ward") | |
plot(fit, hang = -1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment