report: Generic function for creating a report from an object 'x'

View source: R/report.R

reportR Documentation

Generic function for creating a report from an object x

Description

This generic function creates a report based on the object.

Usage

report(
  x,
  file = tempfile(),
  open = TRUE,
  report = "html",
  report_author = "Myself",
  report_title = "Report of something",
  ...
)

## S3 method for class 'character'
report(
  x,
  file = tempfile(),
  open = TRUE,
  report = "html",
  report_author = "Tester",
  report_title = "Validation of data against dmdScheme",
  ...
)

## S3 method for class 'dmdScheme_validation'
report(
  x,
  file = tempfile(),
  open = TRUE,
  report = "html",
  report_author = "Tester",
  report_title = "Validation of data against dmdScheme",
  ...
)

Arguments

x

object of which the report should be creted used to select a method

file

name of the file containing the generated report, including extension. If missing, ot will be saved as a temporary file in the temporary folder.

open

if TRUE, open the report. Default: TRUE

report

determines if and in which format a report of the validation should be generated. Allowed values are:

  • none: no report is generated

  • html: a html (.html) report is generated and opened

  • pdf : a pdf (.pdf) report is generated and opened

  • word: a word (.docx)report is generated and opened Additional values can be implemented by the different methods and will be documented in the Details section.

report_author

name of the author to be included in the report

report_title

title of the report to be included in the report

...

further arguments passed to or from other methods

Details

report.character creates a report of the object returnes from a validate().

report.dmdScheme_validation creates a report of the object returnes from a validate().

Value

return the path and filename of the report

Methods (by class)

  • report(character): report of a dmdScheme_validation object.

  • report(dmdScheme_validation): report of a dmdScheme_validation object.

Examples

## Not run: 
## This examples requires pandoc
## Report of `dmdScheme_validation`
report( scheme_path_xlsx() )

## End(Not run)


## Report of `dmdScheme_validation`
## Not run: 
# This needs pandoc to run successfully
report( validate(dmdScheme_raw()) )
report(
   x = dmdScheme_raw(),
   report = "html",
   report_author = "The Author I am",
   report_title = "A Nice Report"
)

## End(Not run)

Exp-Micro-Ecol-Hub/dmdScheme documentation built on Aug. 31, 2022, 3:17 p.m.