powered by
Build a Social Network Analysis Model
sna(x, aggregate = sum, ...)
A tna object representing the model.
tna
A data.frame or a matrix with three columns: the first two representing the states and the third giving the weights.
data.frame
matrix
A function to use for aggregating the weights. The default is sum().
function
sum()
Additional arguments passed to aggregate.
aggregate
set.seed(123) d <- data.frame( from = sample(LETTERS[1:4], 100, replace = TRUE), to = sample(LETTERS[1:4], 100, replace = TRUE), weight = rexp(100) ) model <- sna(d)
Run the code above in your browser using DataLab