I hereby claim:
- I am justinjm on github.
- I am hianalytics (https://keybase.io/hianalytics) on keybase.
- I have a public key ASArdGwJEbzw7JyWuRaLCyd-RW0s00eecjmU_p1jERz7OQo
To claim this, I am signing this object:
FROM gcr.io/deeplearning-platform-release/r-cpu | |
# install dependencies | |
RUN apt-get update && \ | |
apt-get install -y \ | |
autoconf \ | |
automake \ | |
g++ \ | |
gcc \ | |
cmake \ |
# Takes an ordered vector of numeric values and returns a small bar chart made | |
# out of Unicode block elements. Works well inside dplyr mutate() or summarise() | |
# calls on grouped data frames. | |
sparkbar <- function(values) { | |
span <- max(values) - min(values) | |
if(span > 0 & !is.na(span)) { | |
steps <- round(values / (span / 7)) | |
blocks <- c('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') | |
paste(sapply(steps - (min(steps) - 1), function(i) blocks[i]), collapse = '') |
I hereby claim:
To claim this, I am signing this object:
library(googleAuthR) | |
library(shiny) | |
library(shinyjs) |
# config ------------------------------------------------------------------ | |
## load packages | |
library(googleAuthR) | |
library(bigQueryR) | |
library(dplyr) | |
library(prophet) | |
library(ggplot2) | |
library(plotly) | |
library(scales) |
2017-08-03: Since I wrote this in 2014, the universe, specifically Kirill Müller (https://github.com/krlmlr), has provided better solutions to this problem. I now recommend that you use one of these two packages:
I love these packages so much I wrote an ode to here.
I use these packages now instead of what I describe below. I'll leave this gist up for historical interest. 😆
library(googleAuthR) | |
library(googleAnalyticsR) | |
library(dplyr) | |
#' Get Google Analytics Data for Dashboards | |
#' | |
#' Extract and join session and hit level data from GA, save as | |
#' rds files for dashboards | |
#' | |
#' @param dates date range list of pairs, from and to dates |
import mimetypes | |
import sys | |
from collections import OrderedDict | |
filename = sys.argv[1] | |
def file_type(filename): | |
type = mimetypes.guess_type(filename) | |
return type |