Learn R Programming

ndjson (version 0.2.0)

stream_in: Stream in & flatten an ndjson file into a tbl_dt

Description

Given a file of streaming JSON (ndjson) this function reads in the records and creates a flat data.table / tbl_dt from it.

Usage

stream_in(path)

Arguments

path

path to file (supports "gz" files)

Value

tbl_dt

References

http://ndjson.org/

Examples

Run this code
f <- system.file("extdata", "test.json", package="ndjson")
nrow(stream_in(f))

gzf <- system.file("extdata", "testgz.json.gz", package="ndjson")
nrow(stream_in(gzf))

Run the code above in your browser using DataLab