Skip to contents

Convenience wrapper around morie_ingest_bigquery_build_sql + morie_ingest_bigquery_query: builds a validated, backtick-quoted SELECT against a fully-qualified table and downloads the result.

Usage

morie_ingest_bigquery_table(
  project,
  dataset,
  table,
  where = NULL,
  limit = NULL,
  select = "*",
  billing_project = NULL,
  page_size = 10000L,
  max_rows = Inf,
  quiet = TRUE
)

Arguments

project, dataset, table

Fully-qualified BigQuery table reference, e.g. project = "bigquery-public-data", dataset = "chicago_crime", table = "crime".

where

Optional raw SQL WHERE clause.

limit

Optional LIMIT.

select

Projection list (default "*").

billing_project

Billing project; falls back to GCP_PROJECT, then ADC.

page_size

Rows per download page.

max_rows

Optional cap on rows downloaded.

quiet

Suppress bigrquery progress output.

Value

A base R data.frame.

Examples

if (FALSE) { # nzchar(Sys.getenv("GCP_PROJECT")) && requireNamespace("bigrquery", quietly = TRUE)
# Runs when the caller has bigrquery + a GCP_PROJECT billing project.
# Keyless alternative for the same data: morie_ingest_chicago_crime()
# (Socrata, no account) or the bundled samples in 'rmoriedata'.
df <- morie_ingest_bigquery_table(
  project = "bigquery-public-data",
  dataset = "chicago_crime",
  table   = "crime",
  where   = "year = 2024",
  limit   = 10000L
)
head(df)
}