Skip to contents

Reads one or more RDS objects from the Gradient datalake (AWS S3) by filtering on entity, project, and tag metadata.

Usage

dl_read(
  entity = NULL,
  ...,
  repair_conflicts = FALSE,
  return_type = c("single", "bind", "auto", "tibble", "list"),
  verbose = TRUE,
  project = dl_get_project(),
  env = "prod"
)

Arguments

entity

Optional character vector of entities to read (e.g. "data/srv_main"). If NULL, reads from all entities.

...

Named tag arguments (tag = value).

  • wave A character vector specifying the waves to filter on.

  • type A character vector specifying the types to filter on.

  • name A character vector specifying the names to filter on.

  • version A character vector specifying the versions to filter on.

  • batch A character vector specifying the batches to filter on.

  • source A character vector specifying the sources to filter on.

repair_conflicts

Logical. If TRUE, attempts to coerce conflicting column types to character when binding. Default FALSE.

return_type

One of "single", "bind", "auto", "tibble", or "list".

verbose

Logical. If TRUE, prints progress messages. Default TRUE.

project

Character scalar defining the project name. If NULL, inferred from DESCRIPTION file (Name field).

env

Datalake environment ("prod" or "test"). Default "prod".

Value

Depending on return_type:

  • "single" -> one object or error if none/multiple found

  • "bind" -> bound tibble of all objects (must be data frames)

  • "tibble" -> tibble with metadata and column x (each object)

  • "list" -> named list of objects by key

  • "auto" -> tries to pick best: single, bind, or tibble

Examples

if (FALSE) { # \dontrun{
dl_read(entity = "data/srv_main", project = "g6tr.dl", env = "test")
dl_read(entity = c("data/srv_main", "models/maxdiff"), type = "clean", env = "test")
} # }