[R] Combined variable names

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Dec 1 23:42:41 CET 2004


Kjetil Brinchmann Halvorsen <kjetil at acelerate.com> writes:

> >This is, of course, a FAQ.  It's such a FAQ that I must have seen it
> >once a day for the last several days.
> >
> >What I want to know is *WHY* people are doing this?
> >
> Bad habits from less expressive languages?

Actually, from less _regular_ languages. E.g. SAS will in some
contexts allow v1-v4 for v1 v2 v3 v4, which is expressive, but of
course it means something completely different in other contexts.

R generally tries to be a regular programming language where things
mean the same wherever they are used, so that expressions can be
picked apart and understood piece by piece. E.g. R doesn't allow you
to specify the tail end of an array using syntax like a[i:end], where
"end" would be equivalent to length(a). 

There are irregularities, e.g. the fact that you do help(foo), not
help("foo"), but they tend to get a pain in the long run (How do you
get help on a name contained in a variable? A GUI designer will need a
way to do just that...)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list