hi michael: now give my code and your middle rewrites code to an R novice
and ask them to guess what it does.  ;-).

my personal rule, for the most part, is to go with the clever idiomatic way
when performance or space matter AND, and to go for the simple idiotic way
when I want to understand in a few years what I wrote a while back or when
it requires mental effort, thinking, or research into how to structure it.
 frankly, as I get older, my memory gets worse and worse, possibly because
I have too many other things to take care of at the same time in my day
job.  for my R code, KISS---and I count myself among the S's.

there are of course exceptions to the rule, principally when the idiomatic
way is easier to understand in future years, often when the idiomatic way
is shorter.  your final version clearly qualifies in being elegant and easy
to reread in years to come.  your final version was based on stuff I
learned from reading r-help over the years, so I could have eventually
figured it out.  so, the elegance is appreciated and not lost on me.  I did
not care too much for the middle rewrites.

more relevantly, I wonder whether I should just write a "find" script in
perl and self-parse the .Rd files that are strewn around my hard drive, or
whether there is an idiomatic R way...

best,

/iaw
----
Ivo Welch (ivo.we...@gmail.com)

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to