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
SankeyR <- function(inputs, losses, unit, labels, format="plot"){ | |
######################## | |
# SankeyR version 1.01 (updated August 10, 2010) | |
# is a function for creating Sankey Diagrams in R. | |
# See http://www.sankey-diagrams.com for excellent examples of Sankey Diagrams. | |
# | |
# OPTIONS: | |
# 'inputs' is a vector of input values | |
# 'losses' is a vector of loss values | |
# 'unit' is a string of the unit |
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
#!/usr/bin/env python | |
# Initially written by Heather Piwowar, June 2011 | |
# Public domain: have at it! | |
# For exporting bibtex info into csv for running stats | |
import csv | |
import re | |
from pybtex.database.input import bibtex as bibtex_in | |
from pybtex.database.output import bibtex as bibtex_out | |
from operator import itemgetter, attrgetter |
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
prior_version = 3.3 | |
library_path = .libPaths()[1] | |
library_path = substr(library_path, 1, nchar(library_path)-3) | |
old_library_path=paste0(library_path, prior_version) | |
old_packages = list.files(old_library_path) | |
install.packages(old_packages) |
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
#' @title Mosaic plot using ggplot. | |
#' | |
#' @description | |
#' Creates a mosaic plot where the dimensions of the cells of a | |
#' confusion matrix represent their marginal proportions. | |
#' | |
#' @details | |
#' Credit for initial iteration to | |
#' [Edwin](http://stackoverflow.com/a/19258045/992999) | |
#' This version adds color brewer options and tidies the labelling |
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
```{r setup, echo=FALSE, results='hide'} | |
chunkref <- local({ | |
function(chunklabel) { | |
sprintf('[%s](#%s)', chunklabel, chunklabel ) | |
} | |
}) | |
secref <- local({ | |
function(seclabel) { | |
sprintf('[%s](#%s)', seclabel, seclabel ) |