Skip to content

obscure error with subsetting as.list() of a function then (PR#9506)

1 message · peter-m.schumacher at db.com

#
Ok, thanks for clearing it up. But:
Well if it's intended to work that way then it's not a bug.
As I said, I was computing on the language, in particular writing code =
that
processes the parse tree of a function. But I guess I need to avoid cer=
tain
gotchas like this one.

Regards,
Peter



                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
             Peter Dalgaard <p.dalgaard at biostat.ku.dk>                 =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
             08/02/2007 23:39                                          =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                To 
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                     Peter-M Schumacher=
/DMGGM/DMG UK/DeuBa at DBEMEA                                             =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                cc 
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                     r-devel at stat.math.=
ethz.ch, R-bugs at biostat.ku.dk                                          =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                           Subject 
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                     Re: [Rd] obscure e=
rror with subsetting as.list() of a function then assigning that a (PR#=
9500)                                                                  =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                       =
                                                                   




peter-m.schumacher at db.com writes:
across
it.
ingly, the bug lies
ms the bug lies with
h that new object.


It's not a bug things work in ways that confuse users when they pry
into things they were not expected to pry into.... Do you have a good
reason to call this a bug?

What you're seeing is R's "missing argument object", via the default
value of the formal argument x. A slightly cleaner way to get your
result is
$x
Error: argument "a" is missing, with no default

Technically, the missing argument object is a zero-length variable
name:
[1] "name"
[1] ""


Except for direct meddling with the formals(f), the only way to assign
the missing argument object is via parameter passing - any other
attempt to access it gives an error. So the common case is that the
object is indeed a function argument.
ngdom.1252;LC_MONETARY=3DEnglish_United Kingdom.1252;LC_NUMERIC=3DC;LC_=
TIME=3DEnglish_United Kingdom.1252
raphics, package:grDevices, package:utils, package:datasets, package:me=
thods, Autoloads, package:base
ped}}
--
   O__  ---- Peter Dalgaard             =D8ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 353=
27918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 353=
27907



---

This e-mail may contain confidential and/or privileged infor...{{dropped}}