[Rd] Patch for format.ftable()

Marius Hofert marius.hofert at math.ethz.ch
Tue Mar 5 20:08:25 CET 2013


Dear expeRts,

Please find attached the .diff for a bug fix in R-devel 62124. format.ftable()
fails to format ftable()s correctly which have no row.vars or no
col.vars. That should work with the patch (the example code below also runs
correctly for all the (new) 'method's).

Cheers,

Marius


--8<---------------cut here---------------start------------->8---
(ft1 <- ftable(Titanic, col.vars = 1:4))
(ft2 <- ftable(Titanic, row.vars = 1))
(ft3 <- ftable(Titanic, row.vars = 1:2))
(ft4 <- ftable(Titanic, row.vars = 1:3))
(ft5 <- ftable(Titanic, row.vars = 1:4))

## former version (R-devel 62124)
stats:::format.ftable(ft1) # fails
stats:::format.ftable(ft2)
stats:::format.ftable(ft3)
stats:::format.ftable(ft4)
stats:::format.ftable(ft5) # fails

## all work fine now (format.ftable.() is the patched version):
format.ftable.(ft1)
format.ftable.(ft1, method="row.compact")
format.ftable.(ft1, method="col.compact")
format.ftable.(ft1, method="compact")
format.ftable.(ft2)
format.ftable.(ft2, method="row.compact")
format.ftable.(ft2, method="col.compact")
format.ftable.(ft2, method="compact")
format.ftable.(ft3)
format.ftable.(ft3, method="row.compact")
format.ftable.(ft3, method="col.compact")
format.ftable.(ft3, method="compact")
format.ftable.(ft4)
format.ftable.(ft4, method="row.compact")
format.ftable.(ft4, method="col.compact")
format.ftable.(ft4, method="compact")
format.ftable.(ft5)
format.ftable.(ft5, method="row.compact")
format.ftable.(ft5, method="col.compact")
format.ftable.(ft5, method="compact")
--8<---------------cut here---------------end--------------->8---


-- 
ETH Zurich
Dr. Marius Hofert
RiskLab, Department of Mathematics
HG E 65.2
Rämistrasse 101
8092 Zurich
Switzerland

Phone +41 44 632 2423
http://www.math.ethz.ch/~hofertj
GPG key fingerprint 8EF4 5842 0EA2 5E1D 3D7F  0E34 AD4C 566E 655F 3F7C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mods.diff
Type: text/x-diff
Size: 1642 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20130305/a82a6452/attachment.bin>


More information about the R-devel mailing list