BigQuery Connection – R
Initalizing BigQuery connection
library(bigrquery)
# projectid is your sandbox name (check the URL in your web browser)
# please see gargle and bigrquery documentation for the next two settings
projectid <- "fg-production-sandbox-4"
options(gargle_oauth_cache = FALSE)
bq_auth(scopes = "https://www.googleapis.com/auth/bigquery")
# SQL query as a multiline character string
sql <- paste0(
"SELECT COUNT(*) ",
"FROM finngen-production-library.",
"sandbox_tools_r10.finngen_r10_service_sector_detailed_longitudinal_v2"
# execute the query, download the result
tb <- bq_project_query(projectid, sql)
df <- bq_table_download(tb)
print(df)PreviousProper translations of medical, service sector and provider codesNextCase study – All register data for a person
Last updated
Was this helpful?