2
url <- "http://vlado.fmf.uni-lj.si/pub/networks/data/ucinet/kapmine.dat"
4
dest <- paste(sep="", tmp, "/", "kapmine.dat")
5
download.file(url, dest)
6
l <- readLines(paste(sep="", tmp, "/kapmine.dat"))
8
data <- l[ (grep("^DATA:", l)+1):length(l) ]
9
adata <- l[ (grep("^ROW LABELS:", l)+1):(grep("^COLUMN LABELS:", l)-1) ]
11
tc <- textConnection(data)
15
mat1 <- mat[1:(length(mat)/2)]
16
mat2 <- mat[(length(mat)/2+1):length(mat)]
18
mat1 <- matrix(mat1, sqrt(length(mat1)), byrow=TRUE)
19
mat2 <- matrix(mat2, sqrt(length(mat2)), byrow=TRUE)
20
colnames(mat1) <- rownames(mat1) <- colnames(mat2) <- rownames(mat2) <- adata
23
g1 <- graph.adjacency(mat1, mode="undirected")
24
g2 <- graph.adjacency(mat2, mode="undirected")
26
g1$name <- "Kapferer mine, KAPFMM"
27
g2$name <- "Kapferer mine, KAPFMU"
28
g1$Author <- g2$Author <- "Bruce Kapferer"
29
g1$Citation <- g2$Citation <- "Kapferer B. (1969). Norms and the manipulation of relationships in a work context. In J Mitchell (ed), Social networks in urban situations. Manchester: Manchester University Press.\n\nDoreian P. (1974). On the connectivity of social networks. Journal of Mathematical Sociology, 3, 245-258."
30
g1$URL <- g2$URL <- "http://vlado.fmf.uni-lj.si/pub/networks/data/ucinet/ucidata.htm"
32
kapmine <- list(KAPFMM=g1, KAPFMU=g2)
33
save(kapmine, file="/tmp/kapmine.Rdata.gz")