to_ndjson( 1:5 )
to_ndjson( letters )
mat <- matrix(1:6, ncol = 2)
to_ndjson( x = mat )
to_ndjson( x = mat, by = "col" )
df <- data.frame(
x = 1:5
, y = letters[1:5]
, z = as.Date(seq(18262, 18262 + 4, by = 1 ), origin = "1970-01-01" )
)
to_ndjson( x = df )
to_ndjson( x = df, numeric_dates = FALSE )
to_ndjson( x = df, factors_as_string = FALSE )
to_ndjson( x = df, by = "column" )
to_ndjson( x = df, by = "column", numeric_dates = FALSE )
## Lists are non-recurisve; only elements `x` and `y` are converted to ndjson
lst <- list(
x = 1:5
, y = list(
a = letters[1:5]
, b = data.frame(i = 10:15, j = 20:25)
)
)
to_ndjson( x = lst )
to_ndjson( x = lst, by = "column")
Run the code above in your browser using DataLab