This function generates a mean concentration plot for an ADNCA dataset based on user-selected study IDs, analytes, and cycles. The plot can be customized to display data on a linear or logarithmic scale and can optionally include standard deviation error bars.

general_meanplot(
  data,
  selected_studyids,
  selected_analytes,
  selected_cycles,
  id_variable = "DOSEA",
  plot_ylog = FALSE,
  plot_sd = FALSE
)

Arguments

data

A data frame containing the ADNCA dataset.

selected_studyids

A character vector of selected study IDs to be included in the plot.

selected_analytes

A character vector of selected analytes to be included in the plot.

selected_cycles

A character vector or numeric vector of selected cycles to be included in the plot.

id_variable

A character string specifying the variable by which to color the lines in the plot. Default is "DOSEA".

plot_ylog

A logical value indicating whether to use a logarithmic scale for the y-axis. Default is FALSE.

plot_sd

A logical value indicating whether to include standard deviation error bars. Default is FALSE.

Value

A ggplot object representing the mean concentration plot.