dissect ecxsys()
That function is way too large. Dissect it into smaller functions. Create helper functions where possible.
-
Extract that pmin(pmax(x, 0), 1) into a helper function. -
One function for drc::drm effect~conc (LL.5 und stress_tox) and one for the sys models. -
Completely remove hormesis_index in favour of hormesis_concentration. It's easier to use, less confusing, less error prone, easier to debug, and requires less tests. -
The returned model should be of class "ecxsys" on top of "list". -
Put all drm calls into extra functions and do the options("warn") handling in them.
Edited by Sebastian Henz