Luke Tierney <[EMAIL PROTECTED]> writes:
> There are lot of subtle issues involved here. We should think through
> carefuly exactly what semantics we want for missing value propagation
> before making any changes. Making usage easy at top level is
> genearlly a good thing, but for usage within fu
There are lot of subtle issues involved here. We should think through
carefuly exactly what semantics we want for missing value propagation
before making any changes. Making usage easy at top level is
genearlly a good thing, but for usage within functions eliminating
error messages by making more
On 10/26/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> This is what I get:
>
> > as.missing <- force
> > f <- function(y, x=1) {cat(missing(x)) ; x}
> > g <- function(x=as.missing()) f(3,x)
> > g()
> FALSEError in as.missing() : argument "x" is missing, with no default
> > traceback()
> 3: as
Peter Dalgaard wrote:
>Paul Gilbert <[EMAIL PROTECTED]> writes:
>
>
>
>>Peter Dalgaard wrote:
>>
>>
>>
>>>Paul Gilbert <[EMAIL PROTECTED]> writes:
>>>
>>>
>>>
>>>
>I.e., when x is missing in g, and g calls f(3,x), f will use its
>default value for x.
>
>
>>>
Paul Gilbert <[EMAIL PROTECTED]> writes:
> Peter Dalgaard wrote:
>
> >Paul Gilbert <[EMAIL PROTECTED]> writes:
> >
> >
> >>>I.e., when x is missing in g, and g calls f(3,x), f will use its
> >>>default value for x.
> >>>
> >> Yes, that is the behaviour I am looking for. That is, f should do
> >>
Duncan Murdoch wrote:
> On 10/27/2006 10:24 AM, Peter Dalgaard wrote:
>
>> Paul Gilbert <[EMAIL PROTECTED]> writes:
>>
>>> >I.e., when x is missing in g, and g calls f(3,x), f will use its
>>> >default value for x.
>>> > >
>>> Yes, that is the behaviour I am looking for. That is, f should do
Peter Dalgaard wrote:
>Paul Gilbert <[EMAIL PROTECTED]> writes:
>
>
>
>>>I.e., when x is missing in g, and g calls f(3,x), f will use its
>>>default value for x.
>>>
>>>
>>>
>>>
>>Yes, that is the behaviour I am looking for. That is, f should do what
>>it normal would do if it were ca
On 10/27/2006 10:24 AM, Peter Dalgaard wrote:
> Paul Gilbert <[EMAIL PROTECTED]> writes:
>
>> >I.e., when x is missing in g, and g calls f(3,x), f will use its
>> >default value for x.
>> >
>> >
>> Yes, that is the behaviour I am looking for. That is, f should do what
>> it normal would do if
Paul Gilbert <[EMAIL PROTECTED]> writes:
> >I.e., when x is missing in g, and g calls f(3,x), f will use its
> >default value for x.
> >
> >
> Yes, that is the behaviour I am looking for. That is, f should do what
> it normal would do if it were called with x missing.
But if x has a default i
Bjørn-Helge Mevik wrote:
>Gabor Grothendieck wrote:
>
>
>
>>This is what I get:
>>
>>
>>
>>>as.missing <- force
>>>f <- function(y, x=1) {cat(missing(x)) ; x}
>>>g <- function(x=as.missing()) f(3,x)
>>>g()
>>>
>>>
>>FALSEError in as.missing() : argument "x" is missing, with no defaul
Gabor Grothendieck wrote:
> This is what I get:
>
>> as.missing <- force
>> f <- function(y, x=1) {cat(missing(x)) ; x}
>> g <- function(x=as.missing()) f(3,x)
>> g()
> FALSEError in as.missing() : argument "x" is missing, with no default
>> traceback()
> 3: as.missing()
> 2: f(3, x)
> 1: g()
>> t
This is what I get:
> as.missing <- force
> f <- function(y, x=1) {cat(missing(x)) ; x}
> g <- function(x=as.missing()) f(3,x)
> g()
FALSEError in as.missing() : argument "x" is missing, with no default
> traceback()
3: as.missing()
2: f(3, x)
1: g()
> traceback()
3: as.missing()
2: f(3, x)
1: g()
I don't see how this solves the problem.
> as.missing <- force
> f <- function(y, x=1) {cat(missing(x)) ; x}
> g <- function(x) f(3,x)
> g(1)
FALSE[1] 1
> g()
TRUEError in f(3, x) : argument "x" is missing, with no default
I think I still have to put all the logic in g() to figure out if th
You can do it like this:
> as.missing <- force
> g <- function(x = as.missing()) missing(x)
> g(3)
[1] FALSE
> g()
[1] TRUE
On 10/24/06, Paul Gilbert <[EMAIL PROTECTED]> wrote:
> (I'm not sure if this is a request for a feature, or another instance
> where a feature has eluded me for many years.)
Peter Dalgaard wrote:
>"Charles C. Berry" <[EMAIL PROTECTED]> writes:
>
>
>
>>On Tue, 24 Oct 2006, Duncan Murdoch wrote:
>>
>>
>
>
>
>>>with no defaults. However, this little demo illustrates the point, I think:
>>>
>>>
>>>
g <- function(gnodef, gdef=1) {
>>>
"Charles C. Berry" <[EMAIL PROTECTED]> writes:
> On Tue, 24 Oct 2006, Duncan Murdoch wrote:
> > with no defaults. However, this little demo illustrates the point, I think:
> >
> > > g <- function(gnodef, gdef=1) {
> > +if (missing(gnodef)) cat('gnodef is missing\n')
> > +if (missing(gdef
On Tue, 24 Oct 2006, Duncan Murdoch wrote:
> On 10/24/2006 12:58 PM, Paul Gilbert wrote:
>> (I'm not sure if this is a request for a feature, or another instance
>> where a feature has eluded me for many years.)
>>
>> Often I have a function which calls other functions, and may often use
>> the de
On 10/24/2006 12:58 PM, Paul Gilbert wrote:
> (I'm not sure if this is a request for a feature, or another instance
> where a feature has eluded me for many years.)
>
> Often I have a function which calls other functions, and may often use
> the default arguments to those functions, but needs th
(I'm not sure if this is a request for a feature, or another instance
where a feature has eluded me for many years.)
Often I have a function which calls other functions, and may often use
the default arguments to those functions, but needs the capability to
pass along non-default choices. I usu
19 matches
Mail list logo