plot_levey_jennings: Plot Levey-Jennings chart

View source: R/plots-levey_jennings.R

plot_levey_jenningsR Documentation

Plot Levey-Jennings chart

Description

The function plots a Levey-Jennings chart for the given analyte in the list of plates. The Levey-Jennings chart is a graphical representation of the data that enables the detection of outliers and trends. It is a quality control tool that is widely used in the laboratories across the world.

Usage

plot_levey_jennings(
  list_of_plates,
  analyte_name,
  dilution = "1/400",
  sd_lines = c(1.96),
  data_type = "Median"
)

Arguments

list_of_plates

A list of plate objects for which to plot the Levey-Jennings chart

analyte_name

(character(1)) the analyte for which to plot the Levey-Jennings chart

dilution

(character(1)) the dilution for which to plot the Levey-Jennings chart. The default is "1/400"

sd_lines

(numeric) the vector of coefficients for the standard deviation lines to plot, for example, c(1.96, 2.58) will plot four horizontal lines: mean +/- 1.96sd, mean +/- 2.58sd default is c(1.96) which will plot two lines mean +/- 1.96*sd

data_type

(character(1)) the type of data used plot. The default is "Median"

Value

A ggplot object with the Levey-Jennings chart

Examples

# creating temporary directory for the example
output_dir <- tempdir(check = TRUE)

dir_with_luminex_files <- system.file("extdata", "multiplate_reallife_reduced",
  package = "SerolyzeR", mustWork = TRUE
)
list_of_plates <- process_dir(dir_with_luminex_files,
  return_plates = TRUE, format = "xPONENT", output_dir = output_dir
)
list_of_plates <- rep(list_of_plates, 10) # since we have only 3 plates i will repeat them 10 times

plot_levey_jennings(list_of_plates, "ME", dilution = "1/400", sd_lines = c(0.5, 1, 1.96, 2.58))


SerolyzeR documentation built on April 12, 2025, 2:11 a.m.