Read a JSON blob into an R data frame
Description
Section titled “Description”Reads a JSON file via a storage handler created by [init_storage_handler()(init_storage_handler/) and converts the resulting Python Polars DataFrame to an R data frame. Selected columns specified via col_classes can be cast in Polars before conversion to R.
read_json_blob_as_df(handler, blob_name, col_classes = NULL, ...)Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
handler |
A Python object of class StorageHandler. |
blob_name |
The path/name of the blob/file. |
col_classes |
A named character vector of R column classes. |
... |
Additional arguments passed to handler$read_json_blob(). |
A data frame.
Examples
Section titled “Examples”handler <- init_storage_handler()
df <- read_json_blob_as_df( handler = handler, blob_name = "sample/data.json", col_classes = c( id = "character", customer_id = "character", amount = "numeric", active = "logical", created_at = "POSIXct" ) )