LaTeX Wrappers for R Users

Provides the functionality to write LaTeX code from within R without having to learn LaTeX. Functionality also exists to create HTML and Markdown code. While the functionality still exists to write complete documents with lazyWeave, it is generally easier to do so with with markdown and knitr. lazyWeave's main strength now is the ability to design custom and complex tables for reporting results.


Build Status
DOI

The motivation behind lazyWeave was to reproducible reports among those R users who hadn't yet learned LaTeX. It was, in my opinion, a noble goal, but happened to coincide with the wiser efforts behind the development of the knitr and rmarkdown packages. The development of these tools, which have become so common in the R community, have rendered most of the functionality of lazyWeave obsolete.

So at this point, we may ask, "why lazyWeave at all?" There are a handful of functions that I find quite useful still, and they can still be used in the rmarkdown documents. The functions you'll likely find most useful are:

  • lazy.matrix
  • lazy.table
  • cattable
  • conttable
  • catconttable
  • univ

All of these functions are capable of producing output in LaTeX, HTML, and RMarkdown.

lazyWeave is somewhat similar to the xtable package. What are the advantages of lazyWeave? To be honest, there really aren't a lot. In fact, xtable has quite a few more bells and whistles than lazy.matrix. For instance, with xtable you can turn column headings sideways, or use the longtable package in LaTeX. Eventually, I may add support for these features.

The only advantage lazy.matrix has over xtable is the ability to apply colors to the background of table rows.

The other advantage over xtable is the ability to define multicolumn cells (in LaTeX and HTML only) when building custom tables with lazy.table.

Beyond those basics, cattable, conttable, catconttable, and univ provide ready-made functionality for basic summaries with univariable comparisons. In fact, you may find that they are generally publication ready out of the box.

News

=== Version 3.0.0 === BACK COMPATIBILITY ISSUES

  • When loading the package, the new default for lazyReportFormat is 'markdown'.
  • Another global option was added named 'lazyWeave_cat`. When set to TRUE, the output will be wrapped within cat inside the function. cat will also be added as an argument to the table and figure generating functions. It will not be added within the prose generating functions, since those should not be used in code blocks anyway. This should not affect legacy code.
  • is.significant is not is_significant.

FEATURE CHANGES

  • markdown support. YAY!!!
  • cattable, conttable, and catconttable now accept tbl_df objects in the data argument.
  • 'lazy.matrix' now prints column names in bold text.
  • 'pvalue.QHS' is being removed and replaced with 'pvalString'. 'pvalue.QHS' was not exported, so this shouldn't have much effect on back compatibility. 'pvalString' will be exported and will include options for different styles of pvalue formatting.
  • Additional arguments have been added to 'write.ctable' and 'write.univ' that control the formatting of p-values.

BUG FIXES

  • Additional arguments are added to 'write.univ' to allow suppression of the pvalue column.

=== 20 May 2014 === Some bug fixes have been applied, and the html counters have been moved out of the Global environtment into an environment stored in options()$htmlCounters

=== 10 Sept 2012 ===

The HTML output is now complete. You can toggle between LaTeX and HTML output by using the command

options(lazyReportFormat="latex") or options(lazyReportFormat="html")

The default setting when the package is loaded is "latex"

The other addition to this update is the functions cattable, conttable, catconttable (all can be written to a report with write.ctable) and univ (write to a report with write.univ). I got more comments on my summary tables at UseR than I did on the package itself. So now they're available to anyone who wants them.

=== 18 June 2012 ===

Following the UseR presentation, I've decided to change my plans for this package a little. Instead of uploading a second package (referred to as lazyHTML), I will add the HTML functionality to lazyWeave. An option will be set when the package loads to determine if the output is LaTeX or HTML. This way, I only need to change the output option in options() in order to change the format of my reports.

Also, based on a number of requests, I will move the functions cattable, conttable, catconttable, and write.ctable into lazyWeave. These were the functions that produced the summary table that a number of people expressed interest in. This move may only be temporary. I may move them back into CCFmisc when I get that package ready for CRAN (that could take a little while though).

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("lazyWeave")

3.0.2 by Benjamin Nutter, a year ago


Browse source code at https://github.com/cran/lazyWeave


Authors: Benjamin Nutter [aut, cre]


Documentation:   PDF Manual  


Task views: Reproducible Research


GPL license


Imports Hmisc, labelVector

Suggests testthat


See at CRAN