Learn R Programming

kuzuR (version 0.2.3)

as_tibble.kuzu.query_result.QueryResult: Convert a Kuzu Query Result to a Tibble

Description

Provides an S3 method to convert a Kuzu query result object into a tibble. This requires the tibble package to be installed.

Usage

# S3 method for kuzu.query_result.QueryResult
as_tibble(x, ...)

Value

A tibble containing the query results.

Arguments

x

A Kuzu query result object.

...

Additional arguments passed to as_tibble.

Examples

Run this code
# \donttest{
if (requireNamespace("tibble", quietly = TRUE)) {
  conn <- kuzu_connection(":memory:")
  kuzu_execute(conn, "CREATE NODE TABLE User(name STRING, age INT64,
  PRIMARY KEY (name))")
  kuzu_execute(conn, "CREATE (:User {name: 'Alice', age: 25})")
  result <- kuzu_execute(conn, "MATCH (a:User) RETURN a.name, a.age")

  # Convert the result to a tibble
  tbl <- tibble::as_tibble(result)
  print(tbl)
}
# }

Run the code above in your browser using DataLab