R code, data, and environment to create a social network plot of mutual friends on Facebook as seen in the blog post Mutual Friends Network Analysis in R. People's names and the social circles have been coded to protect identities.
There are four files to be pulled:
- 'association_GIT_final.csv' is a dataframe containing (1) the friend number, (2) the social group which I have organized them to (based on how I know them), and (3) the friend code, which is their name.
- 'network_GIT_final.csv' is the network matrix. You need to delete the first column and make the rownames the same as the column names for this to work.
- 'FB_Social_Circles_GIT.R' is the script to create the network analysis plot in R.
- 'FB_Social_circles_GIT.RDATA' is the R environment containing all the objects.
My random number generator (which you can set with
RNGkind()
) is set to "L'Ecuyer-CMRG"
, so if you're getting very different values or orientations from mine, consider changing your random number generator to match mine.
Have fun!