Created
July 2, 2013 02:53
-
-
Save ColCarroll/5906469 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
get_psu_sample <- function(){ | |
nodeinfo <- read.table("http://www.stat.psu.edu/~dhunter/Rnetworks/nodal.attr.txt", head=T) | |
nodeinfo <<- cbind(1:nrow(nodeinfo),nodeinfo) | |
names(nodeinfo)[1] <<- "id" | |
myedges <<- read.table("http://www.stat.psu.edu/~dhunter/Rnetworks/edgelist.txt") | |
} | |
network_example <- function(){ | |
require(network) | |
diseasenw <- network(myedges, directed=F, bipartite=132, vertex.attr = nodeinfo) | |
plot(diseasenw) | |
plot(diseasenw, vertex.col = 3-nodeinfo$race, vertex.sides = 2+nodeinfo$sex) | |
} | |
igraph_example <- function(){ | |
require(igraph) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment