Skip to content

Instantly share code, notes, and snippets.

View gweissman's full-sized avatar

Gary Weissman gweissman

View GitHub Profile
@gweissman
gweissman / 4d_brain_teaser.R
Created April 15, 2012 01:13
Alternative approach to 4-digit brain teaser...
# alternative approach to teaser game
library(gtools)
library(lattice)
# get data set
load(url('http://www.babelgraph.org/data/brain_teaser_data.Rdata'))
ls()
# set operators
@gweissman
gweissman / dynamic_code.R
Created April 14, 2012 17:04
Dynamic code generation in R
# come up with some code elements
num1 <- 10
num2 <- 5
operators <- c('+','-')
# create a string of the desired code
@gweissman
gweissman / sample_quote_eval.R
Created April 13, 2012 15:45
Sample code using quote and eval in R
# write some code and sit on it
mycode <- quote(1 + 2 +3)
# some time later, at your convenience, evaluate the code
eval(mycode)