R Package for superQuery
These instructions will get you up and running in RStudio to query data from SuperQuery.
- RStudio
(NOT AVAILABLE YET) Binary packages for OS-X or Windows can be installed directly from CRAN:
install.packages("supeR")
(AVAILABLE) The development version from github:
# install.packages("devtools")
devtools::install_github("superquery/supeR")
devtools::install_github("r-dbi/RMySQL")
- Go to superquery.io and log in/sign up
- In the left side-bar, click on the "Integrations" icon
- Scroll down until you see "MySQL" and click "Connect"
- Note the username and password
- Set these two environment variables in your local environment:
export SUPERQUERY_USERNAME=xxxxxx
export SUPERQUERY_PASSWORD=xxxxxx
- Or in RStudio:
Sys.setenv(SUPERQUERY_USERNAME="xxxxxx")
Sys.setenv(SUPERQUERY_PASSWORD="xxxxxx")
- Get your autentication details (See "Authentication" above)
- Import the supeR library:
library(supeR)
- Decide what SQL statement you'd like to run:
query <- "SELECT name FROM `bigquery-public-data.usa_names.usa_1910_current` LIMIT 10"
- Get your results:
res <- sqQuery(jobId = "yyy", sql=query)
- View your results:
View(res@result)
- View your stats:
View(res@stats)
- Override your host:
res <- sqQuery(jobId = "yyy", sql=query, host="proxy-dev.superquery.io")
- Set your Google Cloud billing project:
res <- sqQuery(jobId = "yyy", sql=query, projectId="zyx")
- Set your Row Fetch chunk size:
res <- sqQuery(jobId = "yyy", sql=query, rowFetch=10)
- Set your credentials manually:
res <- sqQuery(jobId = "yyy", sql=query, username="xxx", password="yyyy")
- [RStudio] Version 1.2.5001
- Corrie Painter - v0.1
- Eben du Toit
This project is licensed under the MIT License - see the LICENSE.md file for details
- The awesome people at superQuery