Step 1

Step 2

  • Once you have connected R-Studio to github and downloaded the workshop:
    • Open up the lab
      • You can also open up the lab Rmd file, ERGM_lab.Rmd in files you downloaded from github
    • Read through the lab and run the R code.
    • Provided on github is the tutorial, Rscript and lab exercises and necessary data.
      • Compile the whole lab into a .pdf if you installed latex.
    • Do the exercises in the Lab Exercises (data provided through git). ## Notes
    • This lab requires you to install packages
    install.packages("sna")
    install.packages("network")
    install.packages("ergm")
    install.packages("coda")
    install.packages("knitr")
  • Loading packages in R

    library(ergm)
    data(florentine) 
    flomarriage 
    ##  Network attributes:
    ##   vertices = 16 
    ##   directed = FALSE 
    ##   hyper = FALSE 
    ##   loops = FALSE 
    ##   multiple = FALSE 
    ##   bipartite = FALSE 
    ##   total edges= 20 
    ##     missing edges= 0 
    ##     non-missing edges= 20 
    ## 
    ##  Vertex attribute names: 
    ##     priorates totalties vertex.names wealth 
    ## 
    ## No edge attributes
    par(mfrow=c(1,2)) 
    plot(flomarriage, main="Florentine Marriage", cex.main=0.8) 
    summary(flomarriage~edges) 
    ## edges 
    ##    20