This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************* | |
* Automated Creative Testing With Statistical Significance | |
* Version 2.1 | |
* Changelog v2.1 | |
* - Fixed INVALID_PREDICATE_ENUM_VALUE | |
* Changelog v2.0 | |
* - Fixed bug in setting the correct date | |
* - Script now uses a minimum visitors threshold | |
* per Ad instead of AdGroup | |
* - Added the ability to add the start date as a label to AdGroups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim: ft=javascript: | |
/*jslint sloppy: true, vars: true, white: true, nomen: true, browser: true */ | |
/*global SpreadsheetApp, UiApp, UrlFetchApp, Utilities */ | |
/* | |
* A script to automate requesting data from an external url that outputs CSV data. | |
* | |
* Adapted from the Google Analytics Report Automation (magic) script. | |
* @author nickski15@gmail.com (Nick Mihailovski) | |
* @author ianmlewis@gmail.com (Ian Lewis) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bootstrap.list <- c("car", | |
"codetools", | |
"colorspace", | |
"data.table", | |
"devtools", | |
"dplyr", | |
"forecast", | |
"ggplot2", | |
"knitr", | |
"lattice", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* script to export data in all sheets in the current spreadsheet as individual csv files | |
* files will be named according to the name of the sheet | |
* author: Michael Derazon | |
*/ | |
function onOpen() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}]; | |
ss.addMenu("csv", csvMenuEntries); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************** | |
* This script will run through all your AdWords accounts and store your data in | |
* a Google Spreadsheet. | |
* | |
* @author Russell Savage <russellsavage@gmail.com> | |
* @version 1.0 | |
* | |
* THIS SOFTWARE IS PROVIDED BY Russell Savage ''AS IS'' AND ANY | |
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(extrafont) | |
require(ggplot2) | |
font_import(pattern = "GIL", prompt = FALSE) # Import Gill family | |
loadfonts(device="win") # Load them all | |
fonts() # See what fonts are available | |
zp1 <- ggplot(data = iris, | |
aes(x = Sepal.Length, y = Sepal.Width, label = Species)) | |
zp1 <- zp1 + geom_text(family = "Gill Sans MT") | |
zp1 <- zp1 + theme(text=element_text(family="Gill Sans Ultra Bold")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sunlight Foundation style guide: http://design.sunlightlabs.com/projects/Sunlight-StyleGuide-DataViz.pdf | |
# Ram's original Wes Anderson code: https://github.com/karthik/wesanderson/blob/master/R/colors.R | |
#' A Wes Anderson palette generator | |
#' | |
#' These are a handful of color palettes from Wes Anderson movies. | |
#' @param n Number of colors desired. Unfortunately most palettes now only have 4 or 5 colors. But hopefully we'll add more palettes soon. All color schemes are derived from the most excellent Tumblr blog: \href{http://wesandersonpalettes.tumblr.com/}{Wes Anderson Palettes} | |
#' @param name Name of desired palette. Choices are: \code{GrandBudapest}, \code{Moonrise1}, \code{Royal1}, \code{Moonrise2}, \code{Cavalcanti}, \code{Royal2}, \code{GrandBudapest2}, \code{Moonrise3}, \code{Chevalier}, \code{BottleRocket}, \code{darjeeling}, \code{darjeeling2} | |
#' @param type Set to continuous if you require a gradient of colors similar to how heat map works. | |
#' @export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x <- c( | |
'knitr', # A general-purpose package for dynamic report generation in R. | |
# 'sqldf', # For running SQL statements on R data frames, optimized for convenience. | |
'randomForest', # Classification and regression based on a forest of trees using random inputs. | |
'arm', # R functions for processing lm, glm, svy.glm, mer and polr outputs. | |
'ggplot2', # An implementation of the Grammar of Graphics. | |
'gridExtra', # misc. high-level Grid functions | |
'plyr', # Tools for splitting, applying and combining data. | |
'tree', # Classification and regression trees. | |
'gbm', # Generalized Boosted Regression Models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#HWplot.R | |
library(ggplot2) | |
library(reshape) | |
HWplot<-function(ts_object, n.ahead=4, CI=.95, error.ribbon='green', line.size=1){ | |
hw_object<-HoltWinters(ts_object) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### tweetdata.r | |
### Fetch Twitter data and Data Transformations | |
### Requires you have authenticated in auth.R | |
### 15th June 2014 | |
### Mark Edmondson @HoloMarkeD | |
### | |
### For use with Twitter API, processTweets() takes the df$tweetDF data.frame as input | |
### And calculates/transforms data for the plots | |
processTweets <- function(tweetDF, |