A suite of tools for working in the University of Colorado Eureka environment in R.
You can install the development version of EuReka
from
GitHub with:
# install.packages("devtools")
devtools::install_github("thewileylab/EuReka")
In some cases, users may have multiple Google accounts provided by their
institution in addition to their personal Gmail account. Each of these
accounts will need their own set of credentials to access Google
BigQuery through R. EuReka
allows users to cache their credentials
with a “google_account_type” tag in their home directory.
library(EuReka)
eureka_dbCreateToken(google_account_type = 'hdcuser')
This will initiate the OAuth flow, wherein users may log in with the desired Google account. Credentials will be associated with the user supplied tag when the process is complete.
To access these credentials when creating a connection object, reference the “google_account_type” tag in your Eureka connection object:
con <- eureka_dbConnect(project_id = 'your-project-id',
dataset_id = 'your-dataset-id',
bigint_type = 'character',
google_account_type = 'hdcuser')
Often, the bigrquery
package will have trouble parsing very large
integer values. In order to read and manipulate these values in R, these
values must first be CAST as strings so that R will properly interpret
the values as characters.
eureka_collect()
wraps a low level bigrquery
function that accepts a
“bigint” variable, allowing data containing large integer values to be
downloaded as characters. Non integer fields in the dataset will be
parsed according to the BigQuery schema.
interesting_data <- tbl(con, 'table-name') %>%
eureka_collect()
Please note that the EuReka project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.