[Rd] could we add an argument to suppress printing of levels for print.factor()?
A.J. Rossini
rossini@u.washington.edu
22 Apr 2002 15:08:02 -0700
could we add an argument to suppress printing of levels for
print.factor()? i.e.:
print.factor <-
function (x, quote = FALSE, print.levels = TRUE, ...) ## MODIFIED
{
if (length(x) <= 0)
cat("factor(0)\n")
else print(as.character(x), quote = quote, ...)
if (print.levels) { ## ADDED
cat("Levels: ", paste(levels(x), collapse = " "), "\n")
} ## ADDED
invisible(x)
}
I've done this for my local work, but wondering if this is useful in
general?
best,
-tony
--
A.J. Rossini Rsrch. Asst. Prof. of Biostatistics
U. of Washington Biostatistics rossini@u.washington.edu
FHCRC/SCHARP/HIV Vaccine Trials Net rossini@scharp.org
-------------- http://software.biostat.washington.edu/ ----------------
FHCRC: M-W: 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email
UW: Th: 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX
(my friday location is usually completely unpredictable.)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._