Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of S3 method for stat.table class #82

Merged
merged 2 commits into from Jun 9, 2014

Conversation

RomanTsegelskyi
Copy link
Contributor

stat.table
Basic example

library(Epi) 
### one-way
x <- stat.table(tension,list(count(),mean(breaks)),data=warpbreaks) 
pander(x)
### two-way
y <- stat.table(index=list(tension,wool),mean(breaks),data=warpbreaks) 
pander(y)

lgroup <- list(names(dn)[2], dn[[2]])
tgroup <- names(dn)[3]
c.s <- length(dn[[3]])
xx <- rbind(colnames(xx), xx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numbers become strings here, with a bunch of (probably) unneeded decimals. E.g. from your example:

> pander(y)

--------- ---------------- ----------------
                                *wool*     

*tension*       *A*              *B*       

   *L*    44.5555555555556 28.2222222222222

   *M*           24        28.7777777777778

   *H*    24.5555555555556 18.7777777777778
--------- ---------------- ----------------

Probably it would be great to transform the numbers to strings before that with something like:

apply(xx, c(1,2), p, wrap = '')

@RomanTsegelskyi
Copy link
Contributor Author

Fixed that issue.

@daroczig daroczig merged commit d8e5da1 into Rapporter:master Jun 9, 2014
@RomanTsegelskyi RomanTsegelskyi deleted the stat.table branch July 11, 2014 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants