qcReport-methods {qcmetrics} | R Documentation

## Automatic report generation

### Description

The `qcReport` method generates report in various formats taking a `QcMetrics` instance as input. Each individual quality control item produces a section with description of the item and a assessment figure.

### Details

The reporting functions take a `QcMetrics` instance as input, generate the source of the report and compile it into the final format that are currently available are `reporting_pdf`, `reporting_tex`, `reporting_rmd`, `reporting_html` and `reporting_nozzle`. See `qcto` for details about the sectioning functions, that convert individual `QcMetric` objects into adequate report sections.

The package vignette documents the report generation in more details and describes possibilities for customisation.

### Methods

`signature( object = "QcMetrics", reportname = "character", type = "character", author = "character", title = "character", metadata = "logical", toc = "logical", summary = "logical", sessioninfo = "logical", template = "character", clean = "logical", quiet = "logical", reporter, qcto, ...)`

  generates a report for the `QcMetrics` `object`. The report will be named according the `reportname` (default is `qcreprt`)and `type`, the latter defining the output format and the extension. Possible types are `pdf` (default), "tex", "Rmd", "html" (all generated using the package `knitr`) and "nozzle" (generated using the package `Nozzle.R1` package.) A custom `title` can be provided; default is "Quality control report generated with qcmetrics". If no `author` is provided, the default value (`Sys.getenv("USER")`) is used. The addition of a table of contents (default is `FALSE`), a metadata section, a summary section and the session information can be controlled with the `toc`, `metadata`, `summary` and `sessioninformation` arguments. The metadata section is added to the report when present and the other have `TRUE` as default.

  It is possible to supply custom templates using the `template` arguments. Intermediate files are deleted, unless `clean` is set to `FALSE` and verbose output can be turned on by setting `quiet` to `FALSE`.

  The `reporter` and `qcto` arguments are used to convert `QcMetric` and `QcMetrics` objects into report source. See Details and the package vignette for details.

  Addition parameters can be passed to inner functions. For the `pdf` report, passed to `texi2pdf`; for `html`, passed to `markdown::markdownToHTML`.

  The method invisibly returns the name of the report that was generated.

### Examples

    example(QcMetrics)
    show(qcm)

    destdir <- tempdir()
    (report <- file.path(destdir, "testQCReport"))

    ## pdf report
    qcReport(qcm, reportname = report)

    ## Not run:
        ## use pdflatex to generate the pdf file
        qcReport(qcm, reportname = report, texi2dvi = "pdflatex")

    ## End(Not run)

    ## default html report
    html <- qcReport(qcm, reportname = report, type = "html")
    html
    if (interactive())
        browseURL(html)

    ## using a custom css templates
    writeLines("
    body {
        font-size: 14pt;
        width: 650px;
        background: #789855;
        margin-left: auto;
        margin-right: auto;
        margin-top: 20px;
        margin-bottom: 20;
        text-align:justify;
    }", con = "style.css")

    html2 <- qcReport(qcm, reportname = "customreport", template = "style.css", type = "html")
    if (interactive())
        browseURL(html2)

[Package qcmetrics version 1.18.0 Index]