(in progress) R functions for social network analysis