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
# To source this file into an environment to avoid cluttering the global workspace, put this in Rprofile: | |
# my.env <- new.env(); sys.source("C:/PathTo/THIS_FILE.r", my.env); attach(my.env) | |
#----------------------------------------------------------------------- | |
# Load packages, set options and cwd, set up database connection | |
#----------------------------------------------------------------------- | |
## Load packages | |
# require(ggplot2) #plotting | |
# require(plyr) #data manipulation |
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 language="JavaScript"> | |
$(function() { | |
/* Lets the user click on the images to view them in full resolution. */ | |
$("div.figure img").wrap(function() { | |
var link = $('<a/>'); | |
link.attr('href', $(this).attr('src')); | |
link.attr('title', $(this).attr('alt')); | |
link.attr('target', '_blank'); | |
return link; | |
}); |
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
(function() { | |
// Based on article @ http://www.toptal.com/d3-js/towards-reusable-d3-js-charts | |
// Publish a factory method for Chart instances | |
// @usage: | |
// var runningChart = BarChart.instanceOf( {barPadding : 2 } ); | |
// var weatherChart = BarChart.instanceOf() | |
// .fillColor('coral'); | |
window.BarChart = { |
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
license: mit | |
border: no |
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
(function defineVarsFromClassName() { | |
var needVar = $("[class]"), | |
definedVars = ""; | |
for (var i = 0; i < needVar.length; i++) { | |
var $this = $(needVar[i]); | |
var classes = $this.attr("class").split(" "); | |
for (var ii = 0; ii < classes.length; ii++) { | |
var sClassName = $.trim(classes[ii]); | |
if (sClassName.length > 0) { | |
var $us = $("." + sClassName); |