I agree and R2admb makes that possible. Posted the example to show how model.matrix can be used to help generalize the tpl and automate the model generation process.  Presumably reading in text files isn't too slow. Is there an option to read in binary files if there is a large amount of input data?   regards --jeff <br>
<br><div class="gmail_quote">On Tue, Oct 30, 2012 at 5:15 PM, H. Skaug <span dir="ltr"><<a href="mailto:hskaug@gmail.com" target="_blank">hskaug@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Jeff,<br>
<br>
I will not judge what is right or wrong, but here are my simple preferences<br>
over the past 10 years:<br>
1. Communicate between R and ADMB via textfiles, e.g. R2admb<br>
2. Do as much as possible of the pre and post processing in R. Hence<br>
   model.matrix() belongs on the R side.<br>
<br>
Hans<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Oct 30, 2012 at 5:37 PM, Jeff Laake <<a href="mailto:jefflaake@gmail.com">jefflaake@gmail.com</a>> wrote:<br>
> I'm a newbie at ADMB but have been using R for over a decade. Coming from R<br>
> my inclination was to integrate R and ADMB and I found the R2admb package<br>
> that Ben Bolker wrote. That package makes it quite easy to use R in<br>
> constructing TPL files and drive model development from R rather than<br>
> editing TPL in an IDE or text editor. In particular, I'm using model.matrix<br>
> in R to create design matrices that are input as DATA into ADMB. This means<br>
> a basic TPL file can be used without modification to run any number of<br>
> models directly from R.  I mentioned this to a colleague who said that his<br>
> biggest complaint about ADMB was it's lack of tools such as model.matrix.<br>
> When I showed him my approach he suggested that I post a message to the user<br>
> list as others may be interested as well. The following link<br>
> <a href="https://github.com/downloads/jlaake/R2admb/Intro_to_r2admb.pdf" target="_blank">https://github.com/downloads/jlaake/R2admb/Intro_to_r2admb.pdf</a>  will take<br>
> you to a pdf that shows a couple of examples. The first shows how to extend<br>
> simple.tpl to fit any model and the second more useful example fits<br>
> detection curves to line transect data. The code for these examples is at<br>
> <a href="https://github.com/jlaake/R2admb/tree/master/Intro%20to%20R2admb" target="_blank">https://github.com/jlaake/R2admb/tree/master/Intro%20to%20R2admb</a><br>
><br>
> I'd appreciate getting any comments about its usefulness (or not) and my<br>
> admb programming which I'm still learning, I believe that integration of<br>
> admb into R (as in glmmADMB) will help make ADMB more mainstream in ecology<br>
> and other fields.<br>
><br>
> regards --jeff laake<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@admb-project.org">Users@admb-project.org</a><br>
> <a href="http://lists.admb-project.org/mailman/listinfo/users" target="_blank">http://lists.admb-project.org/mailman/listinfo/users</a><br>
><br>
</div></div></blockquote></div><br>