It's because doSimulation.R relies on other functions in TreEvo, so calling it by itself won't work. One way to figure this out:
Function "states" cannot be found. First, see where states is called in doSimulation by grepping in the R directory:
grep states doSimulation.R
You see it's used as a function, states( something ), five times but never defined.
Then doing
grep states *.R | grep function
shows that states() is defined as a function in SetMethods.R . So loading doSimulation.R by itself won't work for running code, as it won't include the states() function (among others).
You can source all the R code in the current working directory by doing
lapply(system('ls *.R',intern=TRUE),source)
which should give you all the functions you need, while using your modified versions (assuming we're in your branch directory) rather than the ones on the main R-forge trunk. You can also simply install your local version of the package:
install.packages("/Users/bomeara/Documents/MyDocuments/Active/TreEvo/pkg-dgates-branch", type="source")
You might modify the DESCRIPTION file or something else in your branch so you can verify that the one you're using when you later call library("TreEvo") is your modified version (i.e., change version number, have it print "Hello, Dan, I already feel less sluggish", etc.).
Hope that helps,
Brian