Description Usage Arguments Value Examples
Function for obtaining and plotting graph (network) objects using ggplot2 and ggnet2 functions.
1 2 |
channel |
connection object as returned by |
graph |
an object of class |
v |
a SQL |
vertexWhere |
optionally, a |
edgeWhere |
optionally, a |
... |
Other arguments passed on to |
allTables |
pre-built information about existing tables. |
test |
logical: if TRUE show what would be done, only (similar to parameter |
a ggplot object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | if(interactive()) {
# initialize connection to Lahman baseball database in Aster
conn = odbcDriverConnect(connection="driver={Aster ODBC Driver};
server=<dbhost>;port=2406;database=<dbname>;uid=<user>;pwd=<pw>")
policeGraphUn = toaGraph("dallaspolice_officer_vertices", "dallaspolice_officer_edges_un",
directed = FALSE, key = "officer",
source = "officer1", target = "officer2",
vertexAttrnames = c("offense_count"), edgeAttrnames = c("weight"))
# visualize the whole graph
showGraph(conn, policeGraphUn, node.label = "vertex.names", node.size="offense_count")
# visualize subgraph using both vertex and edge filters
showGraph(conn, policeGraphUn,
vertexWhere = "officer ~ '[A-Z ].*'", edgeWhere = "weight > 0.10",
node.label = "vertex.names", node.size="offense_count")
}
|
Loading required package: RODBC
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.