[R] Contingency Table - output to odfWeave not working for matrix

Max Kuhn mxkuhn at gmail.com
Sat Feb 20 23:16:04 CET 2010


Polwart Calum,

Although I cannot explain the root issue, it has nothing to do with
odfWeave. See the second command below. I don't know your versions etc
blah blah blah...

> class(with (mydata, table (site_id, reaction)))
[1] "table"
> class(as.matrix(with (mydata, table (site_id, reaction))))
[1] "table"
> library(odfWeave)
Loading required package: XML
> odfTable(as.matrix(with (mydata, table (site_id, reaction))))
Error in UseMethod("odfTable") :
  no applicable method for 'odfTable' applied to an object of class "table"
> debug(odfTable)
> odfTable(as.matrix(with (mydata, table (site_id, reaction))))
debugging in: odfTable(as.matrix(with(mydata, table(site_id, reaction))))
debug: {
    UseMethod("odfTable")
}
Browse[2]> ls()
[1] "x"
Browse[2]> class(x)
[1] "table"

> sessionInfo()
R version 2.10.0 RC (2009-10-18 r50160)
x86_64-apple-darwin9.8.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] odfWeave_0.7.12 XML_2.6-0       lattice_0.17-26

loaded via a namespace (and not attached):
[1] grid_2.10.0  tools_2.10.0
>

Max

On Sat, Feb 20, 2010 at 9:00 AM, Polwart Calum (County Durham and
Darlington NHS Foundation Trust) <calum.polwart at nhs.net> wrote:
> Solved my own problem by using:
>
> odfTable.matrix(
>  as.matrix (
>     with (mydata, table (site_id, reaction))
>  )
> )
>
> ********************************************************************************************************************
>
> This message may contain confidential information. If ...{{dropped:16}}



More information about the R-help mailing list