lc50_export_auto: Save the LC Results of Every Data File (One xlsx per csv)

View source: R/lc50_export_auto.R

lc50_export_autoR Documentation

Save the LC Results of Every Data File (One xlsx per csv)

Description

Reads the csv file(s) at path, computes the LC values with lc50_calculate and writes one 'Excel' workbook per csv file with lc50_export - named after the data file and placed next to the raw data.

Usage

lc50_export_auto(path = NULL, lc = 0.5, method = "traditional", suffix = NULL)

Arguments

path

Character string; a csv file or a folder with csv files, classified with check_path_type. NULL (the default) opens a folder selection dialog.

lc

Numeric; the lethal proportion, passed on to lc50_calculate (default 0.5 = LC50).

method

Character string; the estimation method, passed on to lc50_calculate (default "traditional").

suffix

Optional character string appended to the output file names, e.g. "_v2"; the default NULL adds nothing.

Details

Each csv file is processed completely on its own (read, calculate, export) in its own loop pass, so the outputs of different files can never mix. LB_48.csv produces LB_48.xlsx in the same folder; for a folder every csv file inside is processed the same way. A file that cannot be read is skipped with a message (a single-file input that cannot be read is an error); a file whose computation fails still gets its workbook with the error recorded in the summary sheet. Non-default settings are appended to the names so repeated runs do not overwrite each other: lc = 0.9 gives LB_48_LC90.xlsx, method = "probit" gives LB_48_probit.xlsx.

Value

The paths of the written xlsx files, invisibly.

See Also

lc50_export_plot_auto for the matching figure export, lc50_export for a custom output location

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_auto(tmp)                    # -> <tempdir>/bioassay.xlsx

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