The data analysis language R provides a rich and varied environment. In this video, you learn how to download and ready for use the sna and igraph modules.
- [Instructor] The data analysis language R provides a rich and varied environment where researchers and developers can create, share, and use the base analysis engine in routines created by other R users. In this movie, I will show you how to download and ready for use the sna and igraph modules. I have already run R, and what I'd like to do is see if I have either sna or igraph installed locally, and if not, then I can reach out onto the Internet to download them. I'll start by going to the packages menu, and then the first item is Load Package.
This will look to see which packages I have installed locally on my computer, and I can add using the Library command. So I'll click Load Package, and from the list of items that are installed, I see neither igraph nor sna. So I'll click Cancel, and I will take my second step. If I had seen either sna or igraph, then I would have clicked the Name Event module, and then clicked Okay. But for here, I will go to Packages, and click the second item, which is Set CRAN mirror.
I can now select the mirror that I want to use. The first option, zero, which is for the Cloud, uses the location from which you're connecting to the Internet, your IP address, and then it finds the closest one to you. Otherwise, you could click any of the available items. For example, if you're in Canada, there's one in Manitoba. And if we scroll down, we see that there's several in the U.S. I'm in the Pacific Northwest, so I'll go ahead and click USA (WA), and click Okay. Now that I've done that, I can go to Packages and point to Install Packages.
And what I should see is a long list of all the packages that are available on the mirror site that I selected. The first one I want to look for is igraph, so in the Packages window, I will scroll down... G, H, I. There's igraph. So I'll click that, and click Okay. Would you like to use a personal library instead? I'll say yes. Would you like to create a personal library to install packages into? Yes. So it's installing, and everything appeared correctly, so I have igraph ready to go.
Now we'll do the same thing for sna. So, I will go to Packages. Install. And then scroll down to sna, which is short for social network analysis. There we are. I'll click that, and click Okay, and we'll see the installation routine. Which in this case, was much faster to implement. Now, if I want to ready those two items for use, I need to use the library command. So I'll type library, left parenthesis, igraph, then close the parenthesis and enter.
And everything's good. Looks like I have a couple of repeated function names that'll be masked, so that's fine. And then I'll type Library, and then in parenthesis, (sna) and then enter, and everything looks good. Now that I have those two items installed, I am ready to go, and analyze using sna and igraph in R.
- Formatting data
- Creating network graphs
- Measuring connectedness and betweenness of points
- Calculating networking density
- Describing network components
- Visualizing a network
- Writing a network description to a text file