Learn R Programming

kuzuR (version 0.2.3)

as.data.frame.kuzu.query_result.QueryResult: Convert a Kuzu Query Result to a Data Frame

Description

Provides an S3 method to seamlessly convert a Kuzu query result object into a standard R data.frame.

Usage

# S3 method for kuzu.query_result.QueryResult
as.data.frame(x, ...)

Value

An R data.frame containing the query results.

Arguments

x

A Kuzu query result object.

...

Additional arguments passed to as.data.frame.

Examples

Run this code
# \donttest{
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 data.frame
df <- as.data.frame(result)
print(df)
# }

Run the code above in your browser using DataLab