neuprint_list2df: Parse neuprint return list to a data frame

View source: R/fetch.R

neuprint_list2dfR Documentation

Parse neuprint return list to a data frame

Description

Parse neuprint return list to a data frame

Usage

neuprint_list2df(
  x,
  cols = NULL,
  return_empty_df = FALSE,
  check.names = FALSE,
  stringsAsFactors = FALSE,
  ...
)

Arguments

x

A list returned by neuprint_fetch_custom

cols

Character vector specifying which columns to include (by default all of those named in x, see details).

return_empty_df

Return a zero row data frame when there is no result.

check.names

Whether to convert column names into R friendly form. This is not necessary but would be the default for data.frame were we not to set it ourselves. See as.data.frame for details.

stringsAsFactors

Whether to return character vector columns as factors. Note that the default of FALSE differs from data.frame and friends.

...

Additional arguments passed to as.data.frame

Details

A low level function tailored to the standard neuprint list return format. Should handle those times when jsonlite's simplification doesn't work. The normal return value of neuprint_fetch_custom is a list formatted as follows:

  • columns List of column names

  • data Nested list of data, with each row formatted as a single sublist

  • debug Character vector containing query

If neuprint_list2df receives such a list it will use the columns to define the names for a data.frame constructed from the data field.


natverse/neuprintr documentation built on Sept. 15, 2023, 6:59 a.m.