Skip to content

Instantly share code, notes, and snippets.

View wch's full-sized avatar

Winston Chang wch

View GitHub Profile
@wch
wch / gist:1461760
Created December 11, 2011 17:47
Load and test branches from another person's repository
# ====== Do this once =======
# Add the remote git repository (this needs to be done once):
git remote add wch https://github.com/wch/ggplot2.git
git fetch wch
# Install devtools (this needs to be done once):
install.packages("devtools")
# ====== Do this each time you want to try the code =======
@wch
wch / badcontour-bisectlog.txt
Created January 31, 2012 19:22
git bisect log for ggplot2 contour coloring bug (#381)
git bisect start
# good: [a8b56fd752e9c5c186e1135c2700550560001cbc] New function to benchmark components of plotting
git bisect good a8b56fd752e9c5c186e1135c2700550560001cbc
# bad: [c5b872ed8b086965a17fc9953f25224ce84d0141] Don't test any example that takes over 5 seconds
git bisect bad c5b872ed8b086965a17fc9953f25224ce84d0141
# bad: [fe198da27c375723fb00f63f84724f3ef485dcb4] Message if grouping clearly incorrect in geom_path. Fixes #240
git bisect bad fe198da27c375723fb00f63f84724f3ef485dcb4
# bad: [fdb86c10228dd4bd8d71b8350d86fe5f08aa848b] Merge pull request #205 from davidmorrison/develop
git bisect bad fdb86c10228dd4bd8d71b8350d86fe5f08aa848b
# skip: [a783741bc1563b4a65f24dbcef4e49d34a5da08a] Added two examples to geom_text; non-variable annotation & font size change.
@wch
wch / mytest.r
Created February 1, 2012 04:39
Automatic R testing script for git bisect
#!/usr/bin/Rscript
cat("\n===== Running test script ======\n")
# =========================================
# Functions for marking commit good/bad/skip
# =========================================
markCommitGood <- function() {
cat("Returning code: good (0)\n\n")
quit(status = 0)
@wch
wch / stat_sum_test.r
Created February 1, 2012 06:22
Test for stat_sum
#!/usr/bin/Rscript
cat("\n===== Running test script ======\n")
# =========================================
# Functions for marking commit good/bad/skip
# =========================================
markCommitGood <- function() {
cat("Returning code: good (0)\n\n")
quit(status = 0)
@wch
wch / bisect-tools.r
Created February 2, 2012 05:19
git bisect functions for R
mark_commit_good <- function() {
cat("Returning code: good (0)\n\n")
quit(status = 0)
}
mark_commit_bad <- function() {
cat("Returning code: bad (1)\n\n")
quit(status = 1)
}
mark_commit_skip <- function() {
@wch
wch / granova_test.r
Created February 2, 2012 06:24
bisect test for geom_rug_alt() problem in granovaGG
#!/usr/bin/Rscript
# =========================================
# Functions for devtools
# =========================================
mark_commit_good <- function() {
cat("Returning code: good (0)\n\n")
quit(status = 0)
}
mark_commit_bad <- function() {
@wch
wch / test_scale_fill_manual.r
Created February 4, 2012 21:23
scale_fill_manual order test
#!/usr/bin/Rscript
# To run this script:
# git bisect reset
# git bisect start master remotes/origin/ggplot-0.8.9
# git bisect run test_scale_fill_manual.r
# When finished:
# git bisect reset
@wch
wch / test_scale_x_crash.r
Created February 8, 2012 00:42
bisect test scale_x_continuous
#!/usr/bin/Rscript
# To run this script:
# git bisect reset
# git bisect start fd6b67 remotes/origin/ggplot-0.8.9
# git bisect run test_scale_x_crash.r
# When finished:
# git bisect reset
@wch
wch / test_legend_NA.r
Created February 8, 2012 00:49
bisect test NA's in color legend
#!/usr/bin/Rscript
# To run this script:
# git bisect reset
# git bisect start fd6b67 remotes/origin/ggplot-0.8.9
# git bisect run test_legend_NA.r
# When finished:
# git bisect reset
@wch
wch / annotation-logticks.r
Created February 27, 2012 02:00
Log tick annotation for ggplot2
#' Log tick marks
#'
annotation_logticks <- function (base = 10, sides = "bl",
short = unit(0.1, "cm"), mid = unit(0.2, "cm"), long = unit(0.3, "cm"), ...) {
require(grid)
GeomLogticks$new(base = base, sides = sides,
short = short, mid = mid, long = long, ...)
}
require(proto)