GithubHelp home page GithubHelp logo

super's Introduction

supeR

R package for superQuery

R Package for superQuery

Getting Started

These instructions will get you up and running in RStudio to query data from SuperQuery.

Prerequisites

  • RStudio

Installation

(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")

Authentication

  • 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")

The basic flow

  • 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")

Tested With

  • [RStudio] Version 1.2.5001

Authors

  • Corrie Painter - v0.1
  • Eben du Toit

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • The awesome people at superQuery

super's People

Contributors

super-eben avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.