plot_precision_against_concentration: plot precision against concentration

View source: R/plot_precision_against_concentration.R

plot_precision_against_concentrationR Documentation

plot precision against concentration

Description

Plot nice-looking plots of CS-wise precision against concentration. This function is a convenience function that makes plotting much more efficient than doing it manually.

Usage

plot_precision_against_concentration(
  data,
  units = "mmol/L",
  save = FALSE,
  save_path = getwd(),
  save_name = "Auto",
  save_device = "pdf",
  size = 8
)

Arguments

data

A data table with two ID-columns, namely Comparison and SampleID

units

The units of the analyte considered. These are included in the x-axis name of the plots

save

Save plot to disk. Default is FALSE. If TRUE, you may specify saving location, file and other with the next four parameters

save_path

Saving location given by a string. Default is the working directory

save_name

Name of the plot used to save. If save_name = 'Auto', a generic name is used based on data

save_device

What file do you want to save the plot as. Valid inputs are 'pdf', 'png', 'jpeg', and more. Using 'png' will produce plots with retina dpi

size

What should the size of the saved plot be? The number specified is the height of the plot. The width of the plot is calculated based on this and the golden ratio

Details

If the Measure column in data is lambda, grouping colors will not be included because no groups are available. If more than one comparison is considered, data will go through the function facet_wrap()

Value

A plot (ggplot2 object) based on data. Use lapply() to make multiple plots at once. Then combine the plots using the egg package.

Examples

plot_precision_against_concentration(data = precision_of_replicates(MS_wise(sampled_cs_measurements)))

pernille267/commutability.selectivity documentation built on July 20, 2022, 9:11 a.m.