lc50_export_plot_auto: Save the LC Figure of Every Data File (One image per csv)

View source: R/lc50_export_auto.R

lc50_export_plot_autoR Documentation

Save the LC Figure of Every Data File (One image per csv)

Description

Reads the csv file(s) at path, computes the LC values, draws the regression plot of lc50_plot for every file and saves it with lc50_export_plot - named after the data file and placed next to the raw data.

Usage

lc50_export_plot_auto(
  path = NULL,
  lc = 0.5,
  method = "traditional",
  suffix = NULL,
  device = "tiff",
  dpi = 600,
  width = 12,
  height = 8,
  units = "cm",
  bg = "white",
  font = "TNM",
  unit = NULL,
  shape = c("sigmoid", "linear"),
  ci = TRUE,
  ci_level = 0.95,
  error_bar = TRUE,
  move_thres = 0.5,
  lc_ci = TRUE,
  lc_p = TRUE,
  lc_lab_gap = 0.35,
  lc_lab_gap_right = 0.1,
  lc_lab_dy = 0.1,
  lc_lab_lh = 1.05,
  preview = FALSE
)

Arguments

path, lc, method, suffix

Same as lc50_export_auto.

device, width, height, dpi, units, bg

Figure settings, passed on to lc50_export_plot (defaults "tiff", 12 x 8 cm, 600 dpi, white background).

font, unit, shape, ci, ci_level, error_bar, move_thres, lc_ci, lc_p, lc_lab_gap, lc_lab_gap_right, lc_lab_dy, lc_lab_lh

Plot settings, passed on to lc50_plot unchanged.

preview

Logical (default FALSE); also print every figure on the screen.

Details

The pipeline and the file-naming rules are the same as in lc50_export_auto, plus _linear for shape = "linear": LB_48.csv gives LB_48.tiff, lc = 0.9, method = "probit" gives LB_48_LC90_probit.tiff. The two functions are fully independent: each reads and computes the data on its own, so they can be called alone or in any order. A file whose computation fails gets no figure. With method = "all" the figure shows the first method that succeeded.

Value

Invisibly a list with elements plots (named list of the ggplot objects, e.g. for print() or lc50_export_plot(plots, ...)) and files (paths of the written images).

See Also

lc50_export_auto, lc50_plot, lc50_export_plot

Examples

f <- system.file("extdata", "lc50_example.csv", package = "insectecol")
tmp <- file.path(tempdir(), "lc50_example.csv")
file.copy(f, tmp, overwrite = TRUE)
lc50_export_plot_auto(tmp)               # -> <tempdir>/bioassay.tiff

insectecol documentation built on Oct. 5, 2026, 5:08 p.m.