From pgilbert@bank-banque-canada.ca  Thu Sep 14 15:31:26 2000
From: pgilbert@bank-banque-canada.ca (Paul Gilbert)
Date: Thu, 14 Sep 2000 10:31:26 -0400
Subject: [Rd] classed
Message-ID: <39C0E13E.2710F02D@bank-banque-canada.ca>

For a long time now I've been using a function:

classed <- function (x, cls)
{
    class(x) <- cls
    x
}

as a utility at the end other functions to set the class of an object and return
the object. I've  noticed examples where others have been doing a similar thing
and I think it would be a useful addition to R base (unless there is already
something there to do this - it wouldn't be the first time I've missed
something). The function is useful not so much because it saves a line of code
in other functions, but because I think it encourages a cleaner, easier to read
style.

Paul Gilbert

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] classed
Paul Gilbert