Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # For description, see: https://www.stats.ox.ac.uk/~snijders/siena/EIES_data.htm
- # The Electronic Information Exchange System (EIES) data were collected by Freeman and Freeman (1980). This data set is discussed also in Wasserman and Faust (1994:62-63). This is a network of 32 researchers who participated in an early study on the effects of electronic information exchange, a precursor of email communication.
- # References:
- # Freeman, L.C., and Freeman, S.C., A semi-visible college: Structural effects on a social networks group. Pp. 77-85 in Henderson, M.M., and McNaughton, M.J. (eds.) _Electronic Communication: Technology and Impacts Boulder_, CO: Westview Press, 1980.
- # Wasserman, Stanley, and Katherine Faust. _Social Network Analysis: Methods and Applications._ New York and Cambridge: Cambridge University Press, 1994.
- # To load this dataset, enter the following into R:
- # source("http://pastebin.com/raw.php?i=thqLfnY4")
- library(igraph)
- library(utils)
- firstdir <- getwd()
- newdir <- paste(firstdir, "EIES_data", sep = "/")
- download.file("https://www.stats.ox.ac.uk/~snijders/siena/EIES_data.zip", "EIES_data.zip", method = "wget")
- unzip("EIES_data.zip", exdir = newdir)
- setwd(newdir)
- eiesatts <- read.table("eies.dat", as.is = TRUE, stringsAsFactors = FALSE, strip.white = TRUE, skip = 3, quote = "", nrows = 32)
- colnames(eiesatts) <- c("Researcher", "Original_Code", "Citations", "Discipline")
- eiesatts$Discipline_Name <- c("Sociology", "Anthropology", "Statistics", "Psychology")[eiesatts$Discipline]
- eiesatts$Discipline_Name[3] <- "Communication"
- eiesatts$Discipline_Name[27] <- "Mathematics"
- friend1 <- read.table("EIES.1", sep = " ", as.is = TRUE, strip.white = TRUE)
- friend2 <- read.table("EIES.2", sep = " ", as.is = TRUE, strip.white = TRUE)
- eiesmessages <- read.table("messages.asc", nrows = 32, strip.white = TRUE)
- eies <- list(t1 = friend1, t2 = friend2, messages = eiesmessages)
- rm(friend1, friend2, eiesmessages)
- eies <- lapply(eies, as.matrix)
- eies$t1 <- graph.adjacency(eies$t1, mode = "directed", weighted = TRUE, diag = FALSE)
- # The acquaintance description at Snijders's page is incorrect, as it omits tie strength of 0 and "close friend"
- # A code of 0 indicates "do not know" (I can't imagine what would be less) and 4 indicates "close friend."
- E(eies$t1)$etype <- c("Do not know", "Heard of", "Met", "Friend", "Close Friend")[E(eies$t1)$weight + 1]
- eies$t2 <- graph.adjacency(eies$t2, mode = "directed", weighted = TRUE, diag = FALSE)
- E(eies$t2)$etype <- c("Do not know", "Heard of", "Met", "Friend", "Close Friend")[E(eies$t2)$weight + 1]
- eies$messages <- graph.adjacency(eies$messages, mode = "directed", weighted = TRUE, diag = TRUE)
- eiesvatts <- function(g, atts = eiesatts){
- V(g)$name <- as.character(1:vcount(g))
- for (i in 1:ncol(atts))
- g <- set.vertex.attribute(g, name = colnames(atts)[i], value = atts[, i])
- return(g)
- }
- eies <- lapply(eies, eiesvatts)
- rm(eiesvatts, eiesatts)
- sapply(list.files(), file.remove)
- setwd(firstdir)
- file.remove(newdir)
- file.remove("EIES_data.zip")
- rm(firstdir, newdir)
Advertisement
Add Comment
Please, Sign In to add comment