Re: [Rd] multiple names to assign

2008-07-20 Thread Prof Brian Ripley
Warning does seem sensible (and there is already a test for length  0), 
so I've added one.


Generally R has followed the Unix philosophy of not chatting and trying to 
make sense of the user's inputs (although it has multiple authors, and 
some advocate more of what others see as nannying).  We do see enough 
'what does this error message mean' about *warnings* on R-help to see the 
downside.


On Sun, 13 Jul 2008, Patrick Burns wrote:


'assign' does not give a warning if 'x' has length
greater than 1 -- it just uses the first element:

assign(c('a1', 'a2'), 1:2)

One way of thinking about this is that people using 'assign' get what 
they deserve.


Or possibly intend, although as the help page incorrectly suggested that 
a quoted character string was needed, they would have had to have read 
the source code to know what should happen.


The other is that it is used seldom enough that adding a warning isn't 
going to slow things down appreciably.


Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)


--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] multiple names to assign

2008-07-13 Thread Patrick Burns

'assign' does not give a warning if 'x' has length
greater than 1 -- it just uses the first element:

assign(c('a1', 'a2'), 1:2)

One way of thinking about this is that people using
'assign' get what they deserve.  The other is that it is
used seldom enough that adding a warning isn't going
to slow things down appreciably.


Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] multiple names to assign

2008-07-13 Thread Kasper Daniel Hansen

Biobase has multiassign.

Kasper

On Jul 13, 2008, at 2:39 AM, Patrick Burns wrote:


'assign' does not give a warning if 'x' has length
greater than 1 -- it just uses the first element:

assign(c('a1', 'a2'), 1:2)

One way of thinking about this is that people using
'assign' get what they deserve.  The other is that it is
used seldom enough that adding a warning isn't going
to slow things down appreciably.


Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel