Skip to content
Prev 7610 / 63424 Next

new version of print.factor

Here's what S-plus 6.0 does with abbreviate.arg:

# S-plus 6.0
 > print(factor(c("fooooooo","baaaaaar")))
[1] fooooooo baaaaaar
 > print(factor(c("fooooooo","baaaaaar")), quote=T)
[1] "fooooooo" "baaaaaar"
Levels:
[1] "baaaaaar" "fooooooo"
 > print(factor(c("fooooooo","baaaaaar")),abbreviate.arg=T, quote=T)
fooooooo baaaaaar
"fooo" "baar"
Levels:
[1] "baar" "fooo"

(The function below does not abbreviate vector contents when given 
abbreviate.arg==TRUE, which may be more or less suitable depending on the 
task at hand.  Also, S-plus doesn't print levels unless quote==TRUE or "If 
some of the levels in a factor object are not in represented in the 
object", but this difference was already present in the R.1.5.0 version of 
print.factor.)

-- Tony Plate
At 12:32 PM 6/19/2002 -0700, A.J. Rossini wrote:

            
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._