Giter Club home page Giter Club logo

lookr's Introduction

Introduction

Note This is the Avant fork of this package and contains some fixes for dealing with the Looker API through R.

LookR is an R package that contains functions that interface with the Looker API programmatically—namely LookerSetup and LookerQuery.

Installation

  • Clone the LookR repo to your local machine.

  • Within the R console (install required packages first)

install.packages('RCurl')
install.packages('RJSONIO')
install.packages('digest')
install.packages('stringr')
install.packages('bitops')
install.packages('<path to directory containing tar>/LookR_1.0.tar.gz', repos = NULL, type = 'source')

Examples

library("LookR")

LookerSetup(
	token = "Jkz9GRYoIhyuJ4498FG89Iz",     	 	         # Not a real token
	secret = "v2+MNxMg1vdmijjYbtBhGDFEQSlAUEZd4xWd",         # Not a real secret
	host = "demo.looker.com", 
	port = 443
)

The function LookerSetup takes token, secret, host, and port as mandatory arguments. The function stores these values for use in LookerQuery.

df <- LookerQuery(
 	dictionary="thelook", 
 	query="orders", 
 	fields=c("orders.created_month", "orders.count"), 
 	filters=c("orders.created_date: 24 months", "orders.is_first_purchase: Yes")
)

head(df)

The function LookerQuery takes dictionary, query, and fields as mandatory arguments; filters, limit, and output are optional arguments. (Note: filters are passed as a vector of key-value pairs containing the dimension or measure name and the filter language, separated by a colon.) The output options supported are an R data frame or JSON object—the arguments are output="data.frame" and output="json", respectively.

lookr's People

Contributors

githoov avatar robertzk avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

kfishner

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.