df_to_json_list: Convert data frame to JSON

View source: R/df-to-json.R

df_to_json_listR Documentation

Convert data frame to JSON

Description

Given a data frame, converts each row to a JSON blob and returns the results in a list, to make it easier to iteratively validate data with check_schema_df().

Usage

df_to_json_list(df)

Arguments

df

A data frame

Value

A list of JSON blobs

See Also

check_schema

Examples

if (requireNamespace("jsonlite", quietly = TRUE)) {
  dat <- data.frame(
    x = c(NA, 1L)
  )
  df_to_json_list(dat)
}

Sage-Bionetworks/dccvalidator documentation built on May 7, 2022, 10:32 a.m.