Learn R Programming

PvSTATEM (version 0.2.2)

generate_levey_jennings_report: Generate a Levey-Jennings Report for Multiple Plates.

Description

This function generates a Levey-Jennings report for a list of plates. The report includes layout plot, levey jennings plot, for each analyte and selected dilutions. The report also includes stacked standard curves plot in both monochromatic and color versions for each analyte. The report is generated using the levey_jennings_report_template.Rmd template.

Usage

generate_levey_jennings_report(
  list_of_plates,
  report_title,
  dilutions = c("1/100", "1/400"),
  filename = NULL,
  output_dir = "reports",
  additional_notes = NULL
)

Value

A Levey-Jennings report in HTML format.

Arguments

list_of_plates

A list of plate objects.

report_title

(character(1)) The title of the report.

dilutions

(character) A character vector specifying the dilutions to be included in the report. Default is c("1/100", "1/400").

filename

(character(1)) The name of the output HTML report file. If not provided or set to NULL, the filename will be based on the first plate name, formatted as {plate_name}_levey_jennings.html. If the filename does not contain the .html extension, it will be automatically added. Absolute file paths in filename will override output_dir. Existing files at the specified path will be overwritten.

output_dir

(character(1)) The directory where the report will be saved. Defaults to 'reports'. If NULL, the current working directory will be used. Necessary directories will be created if they do not exist.

additional_notes

(character(1)) Additional notes to be included in the report. Markdown formatting is supported. If not provided, the section will be omitted.

Examples

Run this code
output_dir <- tempdir(check = TRUE)

dir_with_luminex_files <- system.file("extdata", "multiplate_lite",
  package = "PvSTATEM", mustWork = TRUE
)
list_of_plates <- process_dir(dir_with_luminex_files,
  return_plates = TRUE, format = "xPONENT", output_dir = output_dir
)
note <- "This is a Levey-Jennings report.\n**Author**: Jane Doe \n**Tester**: John Doe"

generate_levey_jennings_report(
  list_of_plates = list_of_plates,
  report_title = "QC Report",
  dilutions = c("1/100", "1/200"),
  output_dir = tempdir(),
  additional_notes = note
)

Run the code above in your browser using DataLab