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
#!/bin/bash | |
# knit.sh -- Dave Kleinschmidt, April 2013 | |
# streamline knitting of Rnw files from the command line. | |
usage="Usage: $0 input-filename.Rnw [-nolatex] [-notangle]" | |
if [ $# -lt 1 ]; then | |
echo $usage | |
exit 1 | |
fi |
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(plyr) | |
require(ggplot2) | |
# say dat is a data.frame with the predictor x, grouping variables z1, z2, and z3 (factors or discrete numeric values) | |
# and the observed values are in the variable y. then I would do: | |
dat.summ <- ddply(dat, .(x, z1, z2, z3), summarise, | |
y.mean=mean(y), y.se=sd(y)/sqrt(length(y))) | |
# this is equivalent to |
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
/* collect a one-off keyboard response, using JQuery namespaces to allow multiple, overlapping responses | |
* fcn(e): function to be called with event on key press | |
* keys: vector of allowed keys (as characters, uppercase for alphanumeric) (optional) | |
* to: timeout for response, in ms (optinal) | |
* tofcn: function to be called on timeout (optional) | |
*/ | |
function collect_keyboard_resp(fcn, keys, to, tofcn) { | |
// create unique namespace for this response | |
var namespace = '._resp' + (new Date()).getTime(); |
NewerOlder