From ggrothendieck at gmail.com  Fri Sep 29 19:00:52 2006
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Fri, 29 Sep 2006 13:00:52 -0400
Subject: [Rd] Warning: a final empty element has been omitted
In-Reply-To: <971536df0609290950v2c7c9e6h84bf44bb8e5dc5b7@mail.gmail.com>
References: <f8e6ff050609290920i69d88d0bseff9652efbdcb83d@mail.gmail.com>
	<971536df0609290950v2c7c9e6h84bf44bb8e5dc5b7@mail.gmail.com>
Message-ID: <971536df0609291000g2aa6c3bev11305d0d174fe3ab@mail.gmail.com>

By the way, this seems to be a difference between 2.3.1pat and 2.4.0
since I get the warning using list on
 "R version 2.4.0 alpha (2006-09-16 r39365)"
but not on
 "Version 2.3.1 Patched (2006-06-04 r38279)"

On 9/29/06, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
> Here is a kludge:
>
> List <- function(...) {
>        mc <- match.call()
>        mc <- mc[as.list(mc) != ""]
>        mc[[1]] <- as.name("list")
>        eval(mc, parent.frame())
> }
>
> List(1,2,3,)
>
>
> On 9/29/06, hadley wickham <h.wickham at gmail.com> wrote:
> > How can I suppress this warning?
> >
> > > options(warn = -10)
> > > list(1,2,3,)
> > Warning: a final empty element has been omitted
> > the part of the args list of 'list' being evaluated was:
> >   (1, 2, 3, )
> > [[1]]
> > [1] 1
> >
> > [[2]]
> > [1] 2
> >
> > [[3]]
> > [1] 3
> >
> > > suppressWarnings(list(1,))
> > Warning: a final empty element has been omitted
> > the part of the args list of 'list' being evaluated was:
> >   (1, )
> > [[1]]
> > [1] 1
> >
> >
> > And can anyone add some insight as to why this warning was added?  It
> > was nice to be able to use a construction like:
> >
> > a <- list(
> >  b = 3,
> >  c = 4,
> > )
> >
> > so when you added a new line, you could just copy and paste an existing line.
> >
> > Hadley
> >
> > ______________________________________________
> > R-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>




[Rd] Warning: a final empty element has been omitted
Gabor Grothendieck