(fwd) Re: [R] the underscore ("_") in variable name

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Oct 3 15:29:57 CEST 2000


Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

> > the other hand, both "<" and "-" have multiple other uses.  This leads
> > to lots of possibilities for confusion:
> > 
> >   x <--5 
> >   x < -5
> >   x <- 5
> > 
> > are easily confused, whereas
> > 
> >   x _-5
> >   x < -5
> >   x _ 5
> > 
> > are not.
> 
> No problems if your space key is actually working and you know
> how to use it and (I suppose) care about communicating to your audience.  

I still don't like it... And underscores can't save you from the real
nasty "hanging yourself in the left tail" case - forgetting spaces
around "<" in

x <- long.and.slow.simulation(10000)
# two days later:
sum(x<-3.6)
# [1] 3.6
# ouch...

-- 
   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
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list