# Set Workspace ----
setwd("~/Documents/Classes/Year 5/Fall 2019/Visual Analytics/Module 12")

# Install packages ----
#install.packages("GGally")
#install.packages("network")
#install.packages("sna")
#install.packages("ggplot2")

# Load Dependencies ----
library(GGally)
## Loading required package: ggplot2
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2
library(network)
## network: Classes for Relational Data
## Version 1.15 created on 2019-04-01.
## copyright (c) 2005, Carter T. Butts, University of California-Irvine
##                     Mark S. Handcock, University of California -- Los Angeles
##                     David R. Hunter, Penn State University
##                     Martina Morris, University of Washington
##                     Skye Bender-deMoll, University of Washington
##  For citation information, type citation("network").
##  Type help("network-package") to get started.
library(sna)
## Loading required package: statnet.common
## 
## Attaching package: 'statnet.common'
## The following object is masked from 'package:base':
## 
##     order
## sna: Tools for Social Network Analysis
## Version 2.4 created on 2016-07-23.
## copyright (c) 2005, Carter T. Butts, University of California-Irvine
##  For citation information, type citation("sna").
##  Type help(package="sna") to get started.
library(ggplot2)

# Create some data ----
net = rgraph(10, mode = "graph", tprob = 0.5) 
net = network(net, directed = FALSE)
network.vertex.names(net) = letters[1:10]

# Visualize data 'net' using ggnet2 ----
ggnet2(net)

# Adjust network vis ----
# Change line and node shades
ggnet2(net, node.size = 6, node.color = "black", edge.size = 1, edge.color = "grey")