
Last chance! 50% off unlimited learning
Sale ends in
With the method functions described here, flattened (contingency) tables can be combined
into more complex objects, of class "ftable_matrix"
. For objects of these class
format
and print
methods are provided
# S3 method for ftable
cbind(…, deparse.level=1)# S3 method for ftable
rbind(…, deparse.level=1)
# S3 method for ftable_matrix
cbind(…, deparse.level=1)
# S3 method for ftable_matrix
rbind(…, deparse.level=1)
# S3 method for ftable_matrix
format(x,quote=TRUE,digits=0,format="f",…)
# S3 method for ftable_matrix
Write(x,
file = "",
quote = TRUE,
append = FALSE,
digits = 0,
…)
# S3 method for ftable_matrix
print(x,quote=FALSE,…)
for cbind
and rbind
methods, two or more objects
of class "ftable"
or "ftable_matrix"
; for the other methods: further
arguments, ignored.
ignored, retained for compatibility reasons only.
an object used to select a method.
logical, indicating whether or not strings should be printed with surrounding quotes.
numeric or integer, number of significant digits to be shown.
a format string as in formatC
character string, containing a file path.
logical, should the output appended to the file?
cbind
and rbind
, when used with "ftable"
or "ftable_matrix"
objects, return objects of class "ftable_matrix"
.
# NOT RUN {
ft1 <- ftable(Sex~Survived,Titanic)
ft2 <- ftable(Age+Class~Survived,Titanic)
ft3 <- ftable(Survived~Class,Titanic)
ft4 <- ftable(Survived~Age,Titanic)
ft5 <- ftable(Survived~Sex,Titanic)
tab10 <- xtabs(Freq~Survived,Titanic)
(c12.10 <- cbind(ft1,ft2,Total=tab10))
(r345.10 <- rbind(ft3,ft4,ft5,Total=tab10))
# }
# NOT RUN {
tf <- tempfile()
Write(c12.10,file=tf)
file.show(tf)
# }
Run the code above in your browser using DataLab