From groemping at bht-berlin.de  Mon Nov  2 09:38:53 2009
From: groemping at bht-berlin.de (Ulrike Groemping)
Date: Mon, 2 Nov 2009 00:38:53 -0800 (PST)
Subject: [Rd]  Help with issues for update when defining S3 methods for lm
Message-ID: <26156624.post@talk.nabble.com>


Dear expeRts,

in my package DoE.base, I have defined a generic for lm 
(lm <- function(formula, ...){UseMethod("lm")}) 
and functions lm.design and lm.default (lm.default <- stats::lm). The
namespace exports "lm", and defines the methods with S3method (e.g.
S3method("lm",default)).

This construction causes a problem with update, as e.g. in 

swiss.lm <- lm(Fertility~Education+Examination, swiss)
upd.swiss.lm <- update(swiss.lm, .~.-Examination)

which works without DoE.base loaded, but not with DoE.base loaded. In the
latter case, I get 

Error in eval(expr, envir, enclos) : could not find function "lm.default"

I thought I exactly followed the directions in Section 1.6.2 of "Writing R
extensions". Any suggestions ?

Regards, Ulrike
-- 
View this message in context: http://old.nabble.com/Help-with-issues-for-update-when-defining-S3-methods-for-lm-tp26156624p26156624.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] Help with issues for update when defining S3 methods for lm
Ulrike Groemping