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))
Run the code above in your browser using DataLab