Re: [Rd] How to build a list with missing values? What is missing, anyway?

2012-10-07 Thread Thomas Lumley
On Fri, Oct 5, 2012 at 4:07 PM, Bert Gunter gunter.ber...@gene.com wrote: On Thu, Oct 4, 2012 at 6:31 PM, Peter Meilstrup explain some things, such as under what circumstances one would get a `...` used in incorrect context error. How could it possibly know that? -- Bert By looking at the

Re: [Rd] How to build a list with missing values? What is missing, anyway?

2012-10-05 Thread peter dalgaard
On Oct 5, 2012, at 03:31 , Peter Meilstrup wrote: On Thu, Oct 4, 2012 at 6:12 PM, Bert Gunter gunter.ber...@gene.com wrote: The R Language definition manual explains all of this. Read it. I always reread that before I post to this list. The only relevant mention of missing in the R

Re: [Rd] How to build a list with missing values? What is missing, anyway?

2012-10-05 Thread Bert Gunter
Why not just use the list constructor: theList - setNames(vector(list,3),letters[1:3]) ## The list components are empty = NULL, not NA) This also doesn't seem to be an R-devel topic. -- Bert On Wed, Oct 3, 2012 at 11:21 PM, Josh O'Brien joshmobr...@gmail.com wrote: Say I have argnames - c(a,

Re: [Rd] How to build a list with missing values? What is missing, anyway?

2012-10-05 Thread Bert Gunter
The R Language definition manual explains all of this. Read it. -- Bert On Thu, Oct 4, 2012 at 3:53 PM, Peter Meilstrup peter.meilst...@gmail.com wrote: On Wed, Oct 3, 2012 at 11:21 PM, Josh O'Brien joshmobr...@gmail.com wrote: Say I have argnames - c(a, b, c). From that I want to construct

Re: [Rd] How to build a list with missing values? What is missing, anyway?

2012-10-05 Thread Bert Gunter
On Thu, Oct 4, 2012 at 6:31 PM, Peter Meilstrup peter.meilst...@gmail.com wrote: On Thu, Oct 4, 2012 at 6:12 PM, Bert Gunter gunter.ber...@gene.com wrote: The R Language definition manual explains all of this. Read it. I always reread that before I post to this list. The only relevant

Re: [Rd] How to build a list with missing values? What is missing, anyway?

2012-10-04 Thread Josh O'Brien
Say I have argnames - c(a, b, c). From that I want to construct the equivalent of alist(a=, b=, c=). Here's a one liner that'll do that for you: argnames - letters[1:3] setNames(rep(list(bquote()), length(argnames)), argnames) - Josh -- View this message in context:

Re: [Rd] How to build a list with missing values? What is missing, anyway?

2012-10-04 Thread Peter Meilstrup
On Thu, Oct 4, 2012 at 6:12 PM, Bert Gunter gunter.ber...@gene.com wrote: The R Language definition manual explains all of this. Read it. I always reread that before I post to this list. The only relevant mention of missing in the R Language Definition that I could find were in section 4.1.2 on

[Rd] How to build a list with missing values? What is missing, anyway?

2012-10-03 Thread Peter Meilstrup
This is tangentially related to Hadley's question. Suppose I'm building a function programmatically; I have assembled an expression for the body and I know the names of the arguments it wants to take. Suppose I have some convenience function such that writing make_function(alist(a=, b=),

Re: [Rd] How to build a list with missing values? What is missing, anyway?

2012-10-03 Thread Hadley Wickham
On Wed, Oct 3, 2012 at 9:37 PM, Peter Meilstrup peter.meilst...@gmail.com wrote: This is tangentially related to Hadley's question. Suppose I'm building a function programmatically; I have assembled an expression for the body and I know the names of the arguments it wants to take. Suppose I