| lc50_read | R Documentation |
Reads the raw csv files of a dose-response bioassay (one file per insecticide, population or similar) and returns a list of standardised data frames that the LC functions of the package work with.
lc50_read(path = NULL)
path |
Character string; the data path: a folder (all csv files
inside are read) or a single csv file. If |
Each csv file must contain one row per concentration with three required columns: the concentration, the number of insects tested and the number of dead insects. The column names are matched loosely against the fixed keywords of the csv template, so headers with additional text such as units (e.g. a concentration header with "(mg/L)" appended) are recognised as well. Rows with a concentration of zero are treated as the control group and are used for the Abbott correction during the analysis.
The data are standardised and validated while reading: rows with non-numeric or missing entries are dropped, the number of tested insects must be positive, the number of dead insects must lie between zero and the number of tested insects, at least one concentration greater than zero must be present, and the rows are sorted by increasing concentration. The file encoding is detected automatically (UTF-8 with BOM and GBK are tried), so files written by both English and Chinese versions of 'Excel' can be read.
A named list with one data frame per csv file; the list
elements are named after the files (without extension) and each
data frame has the columns Concentration, Tested and
Dead.
Abbott, W. S. (1925) A method of computing the effectiveness of an insecticide. Journal of Economic Entomology 18(2), 265-267.
lc50_calculate for the analysis workflow,
check_path_type for the path handling.
f <- system.file("extdata", "lc50_example.csv", package = "insectecol")
lcd <- lc50_read(f)
lcd$bioassay
if (interactive()) lcd <- lc50_read() # interactive folder dialog
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.