Skip to contents

Read a previously shared data set

Usage

lkup_read_shared(url, type, as_data_frame = TRUE, progress = TRUE, ...)

Arguments

url

a valid authenticated URL (these expire)

type

the type of file to read: "json", "csv", or "parquet"

as_data_frame

logical, return as tibble (TRUE) or list for JSON (FALSE)

progress

logical, display a progress bar?

...

additional arguments passed to underlying read functions

Value

Depends on the type argument:

  • "csv": a tibble (via readr::read_csv())

  • "parquet": a tibble (via arrow::read_parquet())

  • "json" with as_data_frame = TRUE (default): a tibble

  • "json" with as_data_frame = FALSE: a nested list mirroring the JSON structure

Columns depend on the data that was shared and cannot be known in advance. Use the corresponding read_*() function documentation to understand the expected columns for each resource type.

Details

This function wraps readr::read_csv(), arrow::read_parquet(), and JSON parsing logic. The type should match the format specified when the data were shared.

Additional arguments in ... are passed to the underlying read functions to control how data is imported (e.g., column types for CSV).

Examples

if (FALSE) { # \dontrun{
lkup_read_shared("https://example.com/data.csv")
lkup_read_shared("https://example.com/data.json", type = "json")
} # }