https://github.com/lorenasandoval88/autoQC
Sandoval, Lorena (NIH/NCI) [C] to Everyone
https://github.com/lorenasandoval88/autoQC/blob/main/R_script_dev.R
Daniel's download example using a public data source already in BQ:
library(tidyverse)
library(bigrquery)
bq_auth()
project_id <- "nih-nci-dceg-druss"
tb <- bq_project_query(project_id,
"SELECT unique_key, complaint_description, source, status, created_date, close_date, last_update_date, street_number, street_name, incident_zip FROM `bigquery-public-data.austin_311.311_service_requests` LIMIT 100"
)
ds <- bq_dataset(project_id, "dataset_api")
message(bq_dataset_exists(ds))
if (!bq_dataset_exists(ds)){
bq_dataset_create(ds)
message(bq_dataset_exists(ds))
}
xx <- bq_table_download(tb)
xx