| src_bigquery {bigrquery} | R Documentation |
Use src_bigquery to connect to an existing bigquery dataset,
and tbl to connect to tables within that database.
src_bigquery(project, dataset, billing = project, max_pages = 10)
project |
project id or name |
dataset |
dataset name |
billing |
billing project, if different to |
max_pages |
(IGNORED) max pages returned by a query |
## Not run:
library(dplyr)
# To run this example, replace billing with the id of one of your projects
# set up for billing
con <- DBI::dbConnect(dbi_driver(),
project = "publicdata",
dataset = "samples",
billing = "887175176791"
)
DBI::dbListTables(con)
DBI::dbGetQuery(con, "SELECT * FROM gsod LIMIT 5")
# You can also use the dplyr interface
shakespeare <- con %>% tbl("shakespeare")
shakespeare
shakespeare %>%
group_by(word) %>%
summarise(n = sum(word_count)) %>%
arrange(desc(n))
## End(Not run)