Serialize to newline delimited JSON representation
Description
Serialize to newline delimited JSON representation
Usage
<DataFrame>$write_ndjson(file)
Arguments
file
|
File path to which the result will be written. |
Value
NULL
invisibly.
Examples
library("polars")
dat <- as_polars_df(head(mtcars))
destination <- tempfile()
dat$select(pl$col("drat", "mpg"))$write_ndjson(destination)
jsonlite::stream_in(file(destination))
#>
Found 6 records...
Imported 6 records. Simplifying...
#> drat mpg
#> 1 3.90 21.0
#> 2 3.90 21.0
#> 3 3.85 22.8
#> 4 3.08 21.4
#> 5 3.15 18.7
#> 6 2.76 18.1