| convert_df | R Documentation |
This function takes a query result object and transforms it into a data frame
with specified field names. For each entry in the query result, it attempts
to extract values corresponding to the given field names. If a particular field
does not exist in the entry, it is replaced with NA.
convert_df(
query_result,
field_names = c("node_id", "n.identifier", "n.name", "n.source")
)
query_result |
A list (or similar structure) representing the query result, typically containing entries from which fields can be extracted. |
field_names |
A character vector of field names to be extracted from each
entry in |
A data frame with one row per entry in query_result, and columns
corresponding to the specified field_names. Missing fields are filled with NA.
# Suppose query_result is a list of named lists:
query_result = list(
list(node_id = 1, n = list(identifier = 1, name = "some node", source = "internet")),
list(node_id = 2, n = list(identifier = 2, name = "some other node", source = "library"))
)
query_result_df = convert_df(
query_result,
field_names = c("node_id", "n.identifier", "n.name", "n.source")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.