From Sebastian.Wastl.Meyer at campus.lmu.de  Sun Nov 15 17:05:09 2009
From: Sebastian.Wastl.Meyer at campus.lmu.de (Sebastian.Wastl.Meyer at campus.lmu.de)
Date: Sun, 15 Nov 2009 17:05:09 +0100 (CET)
Subject: [Rd] model.frame error with formula=~1 and na.action=na.fail
	(PR#14066)
Message-ID: <20091115160509.C7D172830314@mail.pubhealth.ku.dk>

Full_Name: Sebastian Meyer
Version: 2.10.0
OS: x86_64-pc-linux-gnu
Submission from: (NULL) (77.135.124.96)


When using model.frame (model.frame.default) on an intercept-only model and with
na.action=na.fail SPECIFIED, i.e.

   data(iris)
   model.frame( ~ 1, data = iris, na.action = na.fail)

one gets the following error:

   Error in complete.cases(object) : negative length vectors are not allowed

There is no error if the na.action argument is left UNSPECIFIED (though the
default value also is na.fail!):

   model.frame( ~ 1, data = iris)

In either case, there should be no error. Specifing other na.action functions
(na.omit, na.pass, na.exclude) works.
If there is at least one (non-intercept) variable in the formula, e.g.

   model.frame( ~ 1 + Species, data = iris, na.action = na.fail)

there is obviously no issue. 

Best regards,
    Sebastian Meyer



[Rd] model.frame error with formula=~1 and na.action=na.fail (PR#14066)
Sebastian.Wastl.Meyer at campus.lmu.de