Skip to content
Prev 44224 / 398503 Next

predict function

On Sat, 14 Feb 2004 10:41:41 -0500, you wrote:

            
Or

 getAnywhere('predict.loess')

or

 getS3method('predict','loess')

(which are both good to know, because predict.loess won't be in modreg
in 1.9, it's in the new "stats" package).

Rolf said:
Things weren't so simple in the old days in cases where two packages
both defined their own predict.loess functions, or when a user created
a function named "c" or "t", or in lots of other situations of name
collisions.  When two things had the same name, problems were really
likely to arise.

The point of namespaces is to protect the code in packages from
accidental name collisions.  Packages with namespaces can safely use
c() and t() and know what is going to happen.

The decision not to export the name "predict.loess" follows from the
general principle that you shouldn't export things unless you need to.
You should be calling "predict".  If you really need to call
"predict.loess" and "predict" won't get you there, you need to jump
through extra hoops to get it.

Duncan Murdoch