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

pander: pander.tabular #157

Closed
wants to merge 3 commits into from
Closed

Conversation

Dongcan-Jiang
Copy link

The patch implements a method for table::tabular as pander.tabular which
can work with any number of variables with even complex table layouts.[1]

One test case is added to test-S3.R. In this case, a tabular object is created
by tables::as.tabular instead of tabular, so that the test file has no need to
load the whole 'tables' library, which I think would be better.

The document of pander.tabular is added by roxygen2 (4.1.0) referring to
Alexis L.[2]

You can run the test by:

> library(tables)
> library(pander)
> x <- tabular(as.factor(am) ~ (mpg+hp+qsec) * (mean+median), data = mtcars)
> pander(x, digits=2, emphasize.rownames=FALSE)

[1] https://github.com/rstats-gsoc/gsoc2015/wiki/pander
[2] https://github.com/YoruNoHikage/pander/blob/master/man/pander.tabular.Rd

Helped-by: Gergely Darócz daroczig@rapporter.net
Signed-off-by: Dongcan Jiang dongcan.jiang@gmail.com

@daroczig
Copy link
Member

Thank you! To make this pull request more complete, can you please also add a few test cases, so that coveralls would not deny it? It would be also very useful to present the added value of this application.

The patch implements a method for table::tabular as pander.tabular which
can work with any number of variables with even complex table layouts.[1]

You can run the test by:

    > library(tables)
    > library(pander)
    > x <- tabular(as.factor(am) ~ (mpg+hp+qsec) * (mean+median), data = mtcars)
    > pander(x, digits=2, emphasize.rownames=FALSE)

[1] https://github.com/rstats-gsoc/gsoc2015/wiki/pander

Signed-off-by: Dongcan Jiang <dongcan.jiang@gmail.com>
In this case, a tabular object is created by tables::as.tabular instead of
tabular, so that the test file has no need to load the whole 'tables'
library, which I think would be better.

The document of pander.tabular is added by roxygen2 (4.1.0) referring to
Alexis L.[1]

[1] https://github.com/YoruNoHikage/pander/blob/master/man/pander.tabular.Rd

Helped-by: Gergely Darócz <daroczig@rapporter.net>
Signed-off-by: Dongcan Jiang <dongcan.jiang@gmail.com>
@Dongcan-Jiang
Copy link
Author

@daroczig Thanks for your comments. I've added the test and document then repushed it. But the Travis CI failed. I am very confused about the reason in log "The command "sudo apt-get install r-base-dev pandoc qpdf texinfo texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra libxml2-dev" failed and exited with 100 during ." Could you give me some suggestions? Thanks.

@RomanTsegelskyi
Copy link
Contributor

Sometimes Travis fails for reasons not dependent on code and in this case it seems so. Try just restarting Travis job manually

@daroczig
Copy link
Member

Thank you, guys -- I've restarted the Travis job. And yeah, this happens sometimes. Will update Travis to use Rocker instead of the apt-get heavy commands, which should be a lot faster.

Helped-by: Roman Tsegelskyi <roman.tsegelskyi@gmail.com>
Helped-by: Gergely Darócz <daroczig@rapporter.net>
Signed-off-by: Dongcan Jiang <dongcan.jiang@gmail.com>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.39%) to 54.59% when pulling 3c677e1 on Dongcan-Jiang:master into 54a7adf on Rapporter:master.

@Dongcan-Jiang
Copy link
Author

@daroczig @RomanTsegelskyi Thank you. I've added the test and passed the coveralls.

@daroczig
Copy link
Member

Thank you very much, this is a very valuable pull request. Please do not forget to register later on Google Melange as part of the official GSoC application with a complete program. Also, if you end up with any further improvements to this PR, please push those as well later. I think @RomanTsegelskyi's version is more mature ATM.

@daroczig
Copy link
Member

daroczig commented May 8, 2015

Thank you very much for this submission, but #161 was accepted for GSoC 2015 after all.

@daroczig daroczig closed this May 8, 2015
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.

4 participants