[Rd] obscure error with subsetting as.list() of a function then assigning that a (PR#9500)
Gabor Grothendieck
ggrothendieck at gmail.com
Fri Feb 9 00:17:32 CET 2007
Also note:
missing(a) # TRUE
On 2/8/07, peter-m.schumacher at db.com <peter-m.schumacher at db.com> wrote:
>
>
> Hello. I was writing some code that computes on the language and came across
> this. I can work around it, but thought you might like to know about it.
>
> > f <- function(x) { NULL }
> > a <- as.list(f)[[1]]
> > a # ie print(a)
> Error: argument "a" is missing, with no default
>
> Note it says *argument* "a", which is strange. In fact, and unsurprisingly, the bug lies
> with the object itself, not with print():
>
> > typeof(a)
> Error in typeof(a) : argument "a" is missing, with no default
> > deparse(a)
> Error in deparse(a) : argument "a" is missing, with no default
>
> However, this does work:
> > as.list(f)[[1]]
>
> It prints nothing, which is correct, and there is no error. So it seems the bug lies with
> assigning a name to as.list(f)[[1]] as above, then trying to work with that new object.
>
> Regards,
> Peter-M.Schumacher at db.com
>
>
> --please do not edit the information below--
>
> Version:
> platform = i386-pc-mingw32
> arch = i386
> os = mingw32
> system = i386, mingw32
> status =
> major = 2
> minor = 4.1
> year = 2006
> month = 12
> day = 18
> svn rev = 40228
> language = R
> version.string = R version 2.4.1 (2006-12-18)
>
> Windows XP Professional (build 2600) Service Pack 2.0
>
> Locale:
> LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252
>
> Search Path:
> .GlobalEnv, file:c:/schupl/R/myRLib/.RData, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, package:methods, Autoloads, package:base
> ---
>
> This e-mail may contain confidential and/or privileged infor...{{dropped}}
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
More information about the R-devel
mailing list