Skip to content
Prev 82320 / 398502 Next

R is GNU S, not C.... [was "how to get or store ....."]

On Tue, 06-Dec-2005 at 01:00PM +0000, Adaikalavan Ramasamy wrote:
|> Yes, it drives me mad too when people use "=" instead of "<-" for
|> assignment and suppress spaces in an naive attempt for saving space. 
|> 
|> As an example compare 
|> 	
|> 	o=fn(x=1,y=10,z=1)
|> 
|> with
|> 
|> 	o <- fn( x=1, y=10, z=1 )


Or better still:

o <- fn(x = 1, y = 10, z = 1)

The effect is more marked when the arguments are whole words rather
than the single letter names in this example.

Compare

o <- fn(xena = log, yacht = 10625, zebra = "green")

with 

o <- fn( xena=log, yacht=10625, zebra="green" )




|> 
|> Regards, Adai
|> 
|> 
|>
|> On Tue, 2005-12-06 at 13:43 +0100, Martin Maechler wrote:
|> > >>>>> "vincent" == vincent  <vincent at 7d4.com>
|> > >>>>>     on Tue, 06 Dec 2005 11:09:36 +0100 writes:
|> > 
|> >     vincent> shanmuha boopathy a ??crit :
|> >     >> a<-function(a,b,c,d)
|> >     >> {
|> >     >> k=a+b
|> >     >> l=c+d
|> >     >> m=k+l
|> >     >> }
|> >     >> 
|> >     >> in this example the function will return only the value of "m"
|> >     >> ...But I like to extract the values of "l" & "k" also.........
|> >     >> which command to use for storing or for extracting those intermediate value.......
|> > 
|> >     vincent> may I suggest, inside your function
|> > 
|> >     vincent> res = c(k, l, m);
|> >     vincent> return(res);
|> > 
|> > please, please,  these trailing ";"  are  *so* ugly.
|> > This is GNU S, not C (or matlab) !
|> > 
|> > {and I have another chain of argments why   "<-" is so more
|> > expressive than "="  but I'll be happy already if you could
|> > drop these ugly empty statements at the end of your lines...
|> > 
|> >     vincent> # also ... read some intro docs !
|> > 
|> > ______________________________________________
|> > R-help at stat.math.ethz.ch mailing list
|> > https://stat.ethz.ch/mailman/listinfo/r-help
|> > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
|> >
|> 
|> ______________________________________________
|> R-help at stat.math.ethz.ch mailing list
|> https://stat.ethz.ch/mailman/listinfo/r-help
|> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Thread (33 messages)

shanmuha boopathy how to get or store the intermediate v?lues while running a function Dec 6 vincent@7d4.com how to get or store the intermediate v?lues while running a function Dec 6 Martin Maechler R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Adaikalavan Ramasamy R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Philippe GROSJEAN R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Adaikalavan Ramasamy R is GNU S, not C.... [was "how to get or store ....."] Dec 6 vincent@7d4.com R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Brian Ripley R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Xiaofan Li R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Jan T. Kim R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Peter Ehlers R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Barry Rowlingson R formatting Dec 6 Patrick Burns R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Peter Dalgaard R formatting Dec 6 Martin Maechler R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Barry Rowlingson R formatting Dec 6 vincent@7d4.com R is GNU S, not C.... [was "how to get or store ....."] Dec 6 (Ted Harding) R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Deepayan Sarkar R is GNU S, not C.... [was "how to get or store ....."] Dec 6 (Ted Harding) R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Patrick Connolly R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Philippe GROSJEAN R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Patrick Connolly R is GNU S, not C.... [was "how to get or store ....."] Dec 6 vincent@7d4.com R is GNU S, not C.... [was "how to get or store ....."] Dec 6 Peter Ehlers R is GNU S, not C.... [was "how to get or store ....."] Dec 7 Dave Roberts R is GNU S, not C.... [was "how to get or store ....."] Dec 7 Gabor Grothendieck R is GNU S, not C.... [was "how to get or store ....."] Dec 7 Jan T. Kim R is GNU S, not C.... [was "how to get or store ....."] Dec 7 Jim Lemon R is GNU S, not C.... [was "how to get or store ....."] Dec 7 Deepayan Sarkar R is GNU S, not C.... [was "how to get or store ....."] Dec 7 Brian Ripley R coding style (was R is GNU S, not C....) Dec 7 Martin Maechler R is GNU S, not C.... [was "how to get or store ....."] Dec 7 vincent@7d4.com R coding style (was R is GNU S, not C....) Dec 8