Sean Zhang wrote:
Dear Jens and Wacek:
I appreciate your answers very much.
I came up an example based on your comments.
I feel the example helped me to understand...(I could be missing your points
though :( )
If so, please let me know.
Simon pointed out the following link:
I would argue that this is a matter of preference and the arguments on
principle for one side or another are not particularly compelling.
When the = was introduced for assignment, an argument was made that
name=value function arguments are also implicitly a kind of assignment.
While Duncan has
Alan Zaslavsky wrote:
I would argue that this is a matter of preference and the arguments on
principle for one side or another are not particularly compelling.
indeed; i have argued (i think...) for treating them as equals, the
vhoice being a matter of taste.
When the = was introduced for
thanks for your supportive comments!
by that time r programs will be scanned directly from your head, i
suppose, and the intelligent scanner will as gladly take - as it will
=, so the problem will rather vanish.
Yes, and maybe the scanner will be more intelligent than the programmer so
when
Sean,
would like to receive expert opinion to avoid potential trouble
[..]
i think the following is the most secure way if one really
really has to do assignment in a function call
f({a=3})
and if one keeps this convention, - can be dropped altogether.
secure is relative, since due to
Jens Oehlschlägel wrote:
Sean,
would like to receive expert opinion to avoid potential trouble
[..]
i think the following is the most secure way if one really
really has to do assignment in a function call
f({a=3})
and if one keeps this convention, - can be dropped
On Thu, Mar 12, 2009 at 8:29 AM, Jens Oehlschlägel oehl_l...@gmx.de wrote:
Thus there is dangerous advice in the referenced blog which reads:
f(x - 3)
which means assign 3 to x, and call f with the first argument set to the
value 3
The thrust of the blog post was the stylistic question
I think Venables' and Ripley's convention makes good sense:
http://www.stat.auckland.ac.nz/mail/archive/r-downunder/2008-October/000300.html
So we not only are explicit about what we are assigning, but where we
are assigning it.
Cheers,
Simon.
On Thu, 2009-03-12 at 17:10 -0700, David M Smith
Dear Jens and Wacek:
I appreciate your answers very much.
I came up an example based on your comments.
I feel the example helped me to understand...(I could be missing your points
though :( )
If so, please let me know.
Simon pointed out the following link:
I think most people find it odd at first if they have always used = but
quickly you get use to it and nothing could be more clear. It is explicit.
It is active and provides a direction, a value goes into an object. The
equal sign for assignment is ambiguous.
As an example
x = 3
we only
Dear R-helpers:
I have a question related to - and =.
I saw very experienced R programmers use = rather than - quite
consistently.
However, I heard from others that do not use = but always stick to - when
assigning valuese.
I personally like = because I was using Matabl, But, would like to
On 3/11/2009 10:18 AM, Sean Zhang wrote:
Dear R-helpers:
I have a question related to - and =.
I saw very experienced R programmers use = rather than - quite
consistently.
However, I heard from others that do not use = but always stick to - when
assigning valuese.
I personally like = because
On Wed, Mar 11, 2009 at 7:18 AM, Sean Zhang seane...@gmail.com wrote:
Dear R-helpers:
I have a question related to - and =.
I saw very experienced R programmers use = rather than - quite
consistently.
However, I heard from others that do not use = but always stick to - when
assigning
Duncan Murdoch wrote:
Use - for assignment, and = for function arguments. Then the
difference between
f( a = 3 )
f( a - 3 )
is clear, and you won't be surprised that a gets changed in the second
case. If you use = for assignment, the two lines above will be
written as
f( a = 3 )
14 matches
Mail list logo