plot_levey_jennings {SerolyzeR} | R 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.
The method takes several parameters that can customise its output.
Except for the required parameters (list_of_plates
and analyte_name
),
the most significant optional ones are dilution
and sd_lines
.
The additional parameters can be used for improving the plots interpretability, by customizing the layout, y-scale, etc.
For better readibilty, the plot is zoomed out in the y
-axis, by a factor of 1.5
.
Usage
plot_levey_jennings(
list_of_plates,
analyte_name,
dilution = "1/400",
sd_lines = c(1, 2, 3),
mfi_log_scale = TRUE,
sort_plates = TRUE,
plate_labels = "number",
label_angle = 0,
legend_position = "bottom",
data_type = "Median"
)
Arguments
list_of_plates |
A list of plate objects for which to plot the Levey-Jennings chart |
analyte_name |
( |
dilution |
( |
sd_lines |
( |
mfi_log_scale |
( |
sort_plates |
( |
plate_labels |
(
|
label_angle |
( |
legend_position |
the position of the legend, a possible values are |
data_type |
( |
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))