[R] replacing ugly for loops

andrewH ahoerner at rprogress.org
Thu Oct 11 23:16:18 CEST 2012


Dear Bert--
I tried your function on the data that I provided (data.df) and it worked
beautifully (after I added a missing final parenthesis), producing exactly
the same output as my function.  This is an excellent example of what I was
looking for, because it is 
   (a) 50% shorter than mine, 
   (b) fully vectorized, and 
   (c) uses three functions that I have never used before: with, unique, and
do.call

I am going to spend a happy afternoon working through this command by
command and at the end I am confident that I will have learned some valuable
new ( to me) tricks. 
Thanks!
Warmest Regards, AndrewH




--
View this message in context: http://r.789695.n4.nabble.com/replacing-ugly-for-loops-tp4645821p4645914.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list