{"id":13720160,"url":"https://github.com/r-dbi/bigrquery","last_synced_at":"2026-02-13T12:19:39.363Z","repository":{"id":8587740,"uuid":"10221246","full_name":"r-dbi/bigrquery","owner":"r-dbi","description":"An interface to Google's BigQuery from R.","archived":false,"fork":false,"pushed_at":"2025-02-24T21:06:08.000Z","size":7996,"stargazers_count":521,"open_issues_count":19,"forks_count":185,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-04-10T22:29:47.657Z","etag":null,"topics":["bigquery","database","r"],"latest_commit_sha":null,"homepage":"https://bigrquery.r-dbi.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"CyanogenMod/android_device_lge_f400","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-dbi.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-05-22T14:04:16.000Z","updated_at":"2025-04-03T21:06:59.000Z","dependencies_parsed_at":"2023-01-13T15:01:04.602Z","dependency_job_id":"a86a7919-101a-4f48-98e4-8ff62f2946cc","html_url":"https://github.com/r-dbi/bigrquery","commit_stats":{"total_commits":648,"total_committers":49,"mean_commits":"13.224489795918368","dds":0.3549382716049383,"last_synced_commit":"ebcc7625d7879ea6f08ba51c8f9ee442d309f395"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dbi%2Fbigrquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dbi%2Fbigrquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dbi%2Fbigrquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-dbi%2Fbigrquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-dbi","download_url":"https://codeload.github.com/r-dbi/bigrquery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253639613,"owners_count":21940449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigquery","database","r"],"created_at":"2024-08-03T01:01:00.426Z","updated_at":"2025-12-18T01:13:42.173Z","avatar_url":"https://github.com/r-dbi.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n\nif (bigrquery:::has_internal_auth()) {\n  bigrquery:::bq_auth_internal()\n} else {\n  knitr::opts_chunk$set(eval = FALSE)\n}\n```\n# bigrquery\n\n\u003c!-- badges: start --\u003e\n[![CRAN Status](https://www.r-pkg.org/badges/version/bigrquery)](https://cran.r-project.org/package=bigrquery)\n[![R-CMD-check](https://github.com/r-dbi/bigrquery/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-dbi/bigrquery/actions/workflows/R-CMD-check.yaml)\n\n[![Codecov test coverage](https://codecov.io/gh/r-dbi/bigrquery/graph/badge.svg)](https://app.codecov.io/gh/r-dbi/bigrquery)\n\u003c!-- badges: end --\u003e\n\nThe bigrquery package makes it easy to work with data stored in \n[Google BigQuery](https://cloud.google.com/bigquery/docs) by allowing you to query BigQuery tables and retrieve metadata about your projects, datasets, tables, and jobs. The bigrquery package provides three levels of abstraction on top of BigQuery:\n\n* The low-level API provides thin wrappers over the underlying REST API. All \n  the low-level functions start with `bq_`, and mostly have the form \n  `bq_noun_verb()`. This level of abstraction is most appropriate if you're\n  familiar with the REST API and you want do something not supported in the \n  higher-level APIs.\n  \n* The [DBI interface](https://r-dbi.org) wraps the low-level API and\n  makes working with BigQuery like working with any other database system.\n  This is most convenient layer if you want to execute SQL queries in \n  BigQuery or upload smaller amounts (i.e. \u003c100 MB) of data.\n\n* The [dplyr interface](https://dbplyr.tidyverse.org/) lets you treat BigQuery \n  tables as if they are in-memory data frames. This is the most convenient \n  layer if you don't want to write SQL, but instead want dbplyr to write it \n  for you.\n\n## Installation\n\nThe current bigrquery release can be installed from CRAN: \n\n```{r eval = FALSE}\ninstall.packages(\"bigrquery\")\n```\n\nThe newest development release can be installed from GitHub:\n\n```{r eval = FALSE}\n#install.packages(\"pak\")\npak::pak(\"r-dbi/bigrquery\")\n```\n\n## Usage\n\n### Low-level API\n\n```{r}\nlibrary(bigrquery)\nbilling \u003c- bq_test_project() # replace this with your project ID \nsql \u003c- \"SELECT year, month, day, weight_pounds FROM `publicdata.samples.natality`\"\n\ntb \u003c- bq_project_query(billing, sql)\nbq_table_download(tb, n_max = 10)\n```\n\n### DBI\n\n```{r, warning = FALSE}\nlibrary(DBI)\n\ncon \u003c- dbConnect(\n  bigrquery::bigquery(),\n  project = \"publicdata\",\n  dataset = \"samples\",\n  billing = billing\n)\ncon \n\ndbListTables(con)\n\ndbGetQuery(con, sql, n = 10)\n```\n\n### dplyr\n\n```{r, message = FALSE}\nlibrary(dplyr)\n\nnatality \u003c- tbl(con, \"natality\")\n\nnatality %\u003e%\n  select(year, month, day, weight_pounds) %\u003e% \n  head(10) %\u003e%\n  collect()\n```\n\n## Important details\n\n### BigQuery account\n\nTo use bigrquery, you'll need a BigQuery project. Fortunately, if you just want to play around with the BigQuery API, it's easy to start with Google's free [public data](https://cloud.google.com/bigquery/public-data) and the [BigQuery sandbox](https://cloud.google.com/bigquery/docs/sandbox). This gives you some fun data to play with along with enough free compute (1 TB of queries \u0026 10 GB of storage per month) to learn the ropes. \n\nTo get started, open \u003chttps://console.cloud.google.com/bigquery\u003e and create a project. Make a note of the \"Project ID\" as you'll use this as the `billing` project whenever you work with free sample data; and as the `project` when you work with your own data.\n\n### Authentication and authorization\n\nWhen using bigrquery interactively, you'll be prompted to [authorize bigrquery](https://cloud.google.com/bigquery/docs/authorization) in the browser. You'll be asked if you want to cache tokens for reuse in future sessions. For non-interactive usage, it is preferred to use a service account token, if possible. More places to learn about auth:\n\n  * Help for [`bigrquery::bq_auth()`](https://bigrquery.r-dbi.org/reference/bq_auth.html).\n  * [How gargle gets tokens](https://gargle.r-lib.org/articles/how-gargle-gets-tokens.html).\n    - bigrquery obtains a token with `gargle::token_fetch()`, which supports\n      a variety of token flows. This article provides full details, such as how\n      to take advantage of Application Default Credentials or service accounts\n      on GCE VMs.\n  * [Non-interactive auth](https://gargle.r-lib.org/articles/non-interactive-auth.html). Explains\n    how to set up a project when code must run without any user interaction.\n  * [How to get your own API credentials](https://gargle.r-lib.org/articles/get-api-credentials.html). Instructions for getting your own OAuth client or service account token.\n\nNote that bigrquery requests permission to modify your data; but it will never do so unless you explicitly request it (e.g. by calling `bq_table_delete()` or `bq_table_upload()`). Our [Privacy policy](https://www.tidyverse.org/google_privacy_policy) provides more info.\n\n## Useful links\n\n* [SQL reference](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators)\n* [API reference](https://cloud.google.com/bigquery/docs/reference/rest)\n* [Query/job console](https://console.cloud.google.com/bigquery/)\n* [Billing console](https://console.cloud.google.com/)\n\n## Policies\n\nPlease note that the 'bigrquery' project is released with a [Contributor Code of Conduct](https://bigrquery.r-dbi.org/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n\n[Privacy policy](https://www.tidyverse.org/google_privacy_policy)\n","funding_links":[],"categories":["Libraries","R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-dbi%2Fbigrquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-dbi%2Fbigrquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-dbi%2Fbigrquery/lists"}