| as_tidygraph | R Documentation |
Converts a Kuzu query result into a tidygraph tbl_graph object.
as_tidygraph(query_result)
query_result |
A |
A tbl_graph object.
if (requireNamespace("tidygraph", quietly = TRUE)) {
conn <- kuzu_connection(":memory:")
kuzu_execute(conn, "CREATE NODE TABLE Person(name STRING,
PRIMARY KEY (name))")
kuzu_execute(conn, "CREATE (p:Person {name: 'Alice'})")
res <- kuzu_execute(conn, "MATCH (p:Person) RETURN p")
g_tidy <- as_tidygraph(res)
print(g_tidy)
rm(conn, res, g_tidy)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.