The purpose of this lab is to familiarize yourself with how networks are created and visualized in R.
In Homework 1 you created two networks. I would like you to continue working with those networks for this homework. Please review Lab 3 - Introduction to Networks in R and Lab 4 - Basics of Network Visualization prior to beginning this lab.
Two IMPORTANT points:
If you created a bipartite (i.e. two-mode) network in Homework 1 for either network, you will need to restructure the network to be unipartite for this assignment. But, this is a simple task! All you have to do is figure out which node set you want to connect and create direct connections between them. For example, if Jon and Julio both attended a Wu-Tang Clan concert, then the bipartite graph is: Jon-Event-Julio. That is, Jon and Julio are connected by the event. To make this unipartite, just remove the event such that you simply have: Jon-Julio.
If you review the instructions below and you feel like your network is not appropriate for the assignment and need to create a different example…that is fine! We will use these networks throughout the course, so I want to make sure you have something you can work with consistently.
Make sense? If you have questions before you begin, just post an issue to the course help page.
For each network you created, do the following:
read.csv()
function or create the network using the
matrix()
function.network
.gplot()
function.gplot()
function.For this homework, you will use a .Rmd template I have created.
Download the template for this
homework prior to beginning the homework. For all the homework
assignments, be sure to show both the solution for your code and write
out your answers in the body text (were relevant). When you have
completed your assignment, click the “Knit” button to render your
.RMD
file into a .HTML
report.
A physical copy of the assignment must be turned in during class on the corresponding due date. This assignment is DUE on 2/7.
.RMD
files are knit into .HTML
and other
formats procedural, or line-by-line.
install.packages()
or
setwd()
are bound to cause errors in knittinglibrary()
in a previous chunkIf All Else Fails: If you cannot determine and fix
the errors in a code chunk that’s preventing you from knitting your
document, add eval = FALSE
inside the brackets of
{r}
at the beginning of a chunk to ensure that R does not
attempt to evaluate it, that is: {r eval = FALSE}
. This
will prevent an erroneous chunk of code from halting the knitting
process.