Skip to content

Commit

Permalink
Include updated graphml files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Deschamps committed Jun 12, 2017
1 parent 296751d commit 604d31e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 109 deletions.
78 changes: 0 additions & 78 deletions .py34/bin/activate

This file was deleted.

1 change: 1 addition & 0 deletions .py34/bin/activate
1 change: 1 addition & 0 deletions .py34/bin/conda
1 change: 1 addition & 0 deletions .py34/bin/deactivate
73 changes: 42 additions & 31 deletions descriptor/create_graphs_in_R.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,28 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Warning message:\n",
"“closing unused connection 4 (/data/links/ALBERTA_ottawa_shooting_october_2014-links.txt)”Warning message in (function (..., deparse.level = 1) :\n",
"“number of columns of result is not a multiple of vector length (arg 1)”"
"Warning message in file(filepath, \"r\"):\n",
"“cannot open file '/data/links/-links.txt': No such file or directory”"
]
},
{
"ename": "ERROR",
"evalue": "Error in file(filepath, \"r\"): cannot open the connection\n",
"output_type": "error",
"traceback": [
"Error in file(filepath, \"r\"): cannot open the connection\nTraceback:\n",
"1. graph.data.frame(unique(processFile(filename2)[c(\"from\", \"to\")]), \n . directed = TRUE)",
"2. as.data.frame(d)",
"3. unique(processFile(filename2)[c(\"from\", \"to\")])",
"4. processFile(filename2)",
"5. file(filepath, \"r\") # at line 4 of file <text>"
]
}
],
Expand All @@ -93,11 +105,11 @@
"\n",
"\n",
"# Change the following file to the \n",
"file = 'ALBERTA_ottawa_shooting_october_2014'\n",
"file = 'ALBERTA_edmonton_public_library'\n",
"# ^^^^^^^^^^^^^^^^^^^^^^^^^^ <- Change to the file name you want. Leave out \"-links.txt\"\n",
"\n",
"suffix = '-links.txt'\n",
"file2 = 'ALBERTA_prairie_provinces'\n",
"#file2 = ''\n",
"# ^^^^^^^^^^^^^^^^^^^^^^^^^^ <- Change to the file name you want. Leave out \"-links.txt\"\n",
"\n",
"\n",
Expand Down Expand Up @@ -137,33 +149,25 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Warning message:\n",
"“closing unused connection 5 (/data/links/ALBERTA_prairie_provinces-links.txt)”"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1] \"Average In-degree: 1.63265306122449\"\n",
"[1] \"Average Out-degree: 1.63265306122449\"\n",
"[1] \"Average Degree: 3.26530612244898\"\n",
"[1] \"Average In-degree: 1.49132964544699\"\n",
"[1] \"Average Out-degree: 1.49132964544699\"\n",
"[1] \"Average Degree: 2.98265929089398\"\n"
"[1] \"Average In-degree: 1.15150736003085\"\n",
"[1] \"Average Out-degree: 1.15150736003085\"\n",
"[1] \"Average Degree: 2.30301472006171\"\n",
"[1] \"Average In-degree: 1.4903156384505\"\n",
"[1] \"Average Out-degree: 1.4903156384505\"\n",
"[1] \"Average Degree: 2.980631276901\"\n"
]
}
],
"source": [
"# Change this to whatever graph_file you want.\n",
"graph_file <- graph_file\n",
"# graph_file <- graph_file\n",
"# ^^^^^^^^^^^ <- Change to graph_file or graph_file2 as required.\n",
"\n",
"#Create vectors for strongly connected components, degree etc.\n",
Expand Down Expand Up @@ -258,7 +262,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"collapsed": true
},
Expand All @@ -271,7 +275,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 7,
"metadata": {
"scrolled": true
},
Expand Down Expand Up @@ -339,7 +343,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 8,
"metadata": {
"collapsed": true
},
Expand All @@ -356,11 +360,18 @@
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Warning message:\n",
"“closing unused connection 5 (/data/links/ALBERTA_prairie_provinces-links.txt)”"
]
}
],
"source": [
"# Write the graphml\n",
"write.graph (graph_file, savename, format='graphml')\n",
Expand All @@ -370,7 +381,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 9,
"metadata": {
"collapsed": true
},
Expand Down

0 comments on commit 604d31e

Please sign in to comment.