stream_in

0th

Percentile

Stream in & flatten an ndjson file into a tbl_dt

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, cls = c("dt", "tbl"))
Arguments
path

path to file (supports "gz" files)

cls

the package uses data.table::rbindlist for speed but that's not always the best return type for everyone, so you have option of keeping it a tbl_dt via "dt" or converting it to a tbl

Value

tbl_dt or tbl or data.frame

References

http://ndjson.org/

Aliases
  • stream_in
Examples
# NOT RUN {
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))
# }
Documentation reproduced from package ndjson, version 0.7.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.