infer: Infer source schema

View source: R/infer.R

inferR Documentation

Infer source schema

Description

Given data source and headers infer will return a Table Schema based on the data values.

Usage

infer(source, options = list())

Arguments

source

data source, one of:

  • string with the local CSV file (path)

  • string with the remote CSV file (url)

  • list of lists representing the rows

  • readable stream with CSV file contents

  • function returning readable stream with CSV file contents

options

any Table.load options

Value

Schema descriptor

Examples

# list of lists data source
source = list(
             list("id"= 1,
                  "age"= 39,
                  "name"= "Paul"),
             list("id"= 2,
                  "age"= 23,
                  "name"= "Jimmy"),
             list("id"= 3,
                  "age"= 36,
                  "name"= "Jane"),
             list("id"= 4,
                  "age"= 28,
                  "name"= "Judy"))

infer(source, options=list(headers=list("id","age","name")))$fields


frictionlessdata/tableschema-r documentation built on Oct. 1, 2022, 11:44 a.m.