-
Notifications
You must be signed in to change notification settings - Fork 1
/
.Rhistory
36 lines (36 loc) · 1.41 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
install.packages("worldfootballR")
library(worldfootballR)
install.packages("X:/code/Playground/patents_0.0.0.9000.tgz", repos = NULL, type = .Platform$pkgType)
install.packages("X:/code/Playground/patents_0.0.0.9000.tgz", repos = NULL, type = .Platform$pkgType)
install.packages("X:\code\Playground\patents_0.0.0.9000.tgz", repos = NULL, type = "source")
install.packages(f"X:\code\Playground\patents_0.0.0.9000.tgz", repos = NULL, type = "source")
install.packages("X:/code/Playground/patents_0.0.0.9000.tgz", repos = NULL, type = "source")
setwd("X:/code/GunSafety_pkg")
library(igraph)
install.packages("igraph")
library(igraph)
library(ggplot2)
install.packages("ggplot2")
library(igraph)
library(ggplot2)
Network_plot <- setRefClass(
"Network_plot",
fields = list(
edge_list = "data.frame"
),
methods = list(
initialize = function() {
edge_list <<- read.csv("data/edge_list.csv")
},
subset_edge_list = function(ids) {
subset(edge_list, V1 %in% ids | V2 %in% ids)
},
plot_network = function(ids, edge_color='brown', node_color='skyblue', node_alpha=0.9, node_size=100, width=1, linewidths=1, figsize=c(10, 10)) {
edge_list_subset <- subset_edge_list(ids)
G <- graph_from_data_frame(edge_list_subset, directed = TRUE)
plot(G, edge.color = edge_color, vertex.color = node_color, vertex.size = node_size,
vertex.frame.color = NA, vertex.label.color = "black", edge.width = width,
edge.arrow.size = 0.5, layout = layout_with_fr(G))
}
)
)