Skip to content

Enhance error bar colors and update to version 3.3.1#190

Merged
hreinwald merged 26 commits intomain_betafrom
dev
Apr 17, 2026
Merged

Enhance error bar colors and update to version 3.3.1#190
hreinwald merged 26 commits intomain_betafrom
dev

Conversation

@hreinwald
Copy link
Copy Markdown
Owner

This pull request updates the drc package to version 3.3.1, introducing a new feature for error bar coloring in plots and fixing several important bugs related to effective dose (ED) calculations and derivatives, especially for the "absolute" ED type in multiple models. It also includes general code cleanups and improved package startup messaging.

New Features

  • Enhanced plot.drc(): Error bars in type = "bars" plots now match the curve colors by default. A new errbar.col parameter allows manual control of error bar colors; setting errbar.col = "black" restores the previous behavior. [1] [2] [3] [4] [5] [6]

Bug Fixes: ED Calculation and Derivatives

  • Fixed logistic() model ED calculation for type="absolute": The edfct function now correctly handles absolute-to-relative conversion inline, avoiding the incorrect p-swap logic from EDhelper(), which was not applicable to the logistic model's parameter conventions. [1] [2] [3]
  • Fixed model-level edfct derivatives for absolute ED type in braincousens(), fplogistic(), llogistic(), llogistic2(), lnormal(), weibull1(), and weibull2(): When type = "absolute", the chain rule was previously ignored, resulting in incorrect zero derivatives for parameters c and d. Now, these derivatives are computed using central differences on closures that capture the full ED computation path, ensuring correct gradient calculations. [1] [2] [3] [4] [5] [6]

General Improvements and Maintenance

  • Updated package version and startup messages to reflect version 3.3.1 and improved the formatting of the startup message. [1] [2]
  • Cleaned up and removed the unused internal function genRetFct.
  • Minor code formatting and comment improvements in R/max.R. [1] [2] [3] [4] [5]

See the NEWS.md file for a detailed changelog.

Claude AI and others added 26 commits April 8, 2026 06:59
Integrated enhancement from DoseResponse#45:
- Added errbar.col parameter to plot.drc() function
- Error bars now match curve colors by default (when errbar.col=NULL)
- Maintains backward compatibility (errbar.col="black" for old behavior)
- Updated barFct functions to accept col parameter
- Updated documentation in R/plot.drc.R and man/plot.drc.Rd
- Updated NEWS.md with new feature description

Agent-Logs-Url: https://github.com/hreinwald/drc/sessions/9afb7ff7-fdbc-426a-b8bd-82ef3c756602

Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
- Updated version from 3.3.0.03 to 3.3.1 in DESCRIPTION
- Updated date to 2026-04-08
- Reorganized NEWS.md to list changes under version 3.3.1
- Removed outdated version reference in Changes section

Agent-Logs-Url: https://github.com/hreinwald/drc/sessions/08c4c988-b4dd-4a76-8fd8-74c231e6f539

Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Empty function without purpose and without any active code. Was removed.
Restored and enhanced documentation for the MAX function, detailing parameters, return values, and usage examples.
- Restored the complete drc 3.3.0.03 section with all features, bug fixes, and changes
- Added new drc 3.3.1 section on top with only the error bar color enhancement

Agent-Logs-Url: https://github.com/hreinwald/drc/sessions/78c2efb0-45dc-4a14-abac-ae3d99a92315

Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Removed docs html for removed genRetFct. This was an empty function with no functional code in it. Clean up step.
Removed docs md for removed `genRetFct`. This was an empty function with no functional code in it. Clean up step.
Delete docs/reference/genRetFct.html
…esponse

Updated drc.plot function with the the feature that the error bar colors now match curve colors. This fix was suggested here: DoseResponse#45
…evel edfct functions

When type='absolute', the edfct functions in model files set derivatives for
c (lower limit) and d (upper limit) to 0. This is incorrect because the
absolute-to-relative conversion makes p depend on c and d, requiring chain-rule
corrections. Use central differences to compute correct c and d derivatives
for absolute type in all affected model files.

Fixes: braincousens.R, fplogistic.R, llogistic.R, llogistic2.R, lnormal.R,
weibull1.R, weibull2.R, logistic.R

Agent-Logs-Url: https://github.com/hreinwald/drc/sessions/7ea3ad01-6a69-4d8a-8c99-5b419f07b01f

Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
…legation path

Agent-Logs-Url: https://github.com/hreinwald/drc/sessions/7ea3ad01-6a69-4d8a-8c99-5b419f07b01f

Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
…d incorrect p-swap

The logistic model has opposite b-sign convention from log-logistic: b < 0 means
increasing (not decreasing). EDhelper swaps p for b < 0, which is correct for
log-logistic but wrong for logistic. Replace with inline absolute-to-relative
conversion that skips the p-swap.

Agent-Logs-Url: https://github.com/hreinwald/drc/sessions/801bd853-cb45-4ae2-8e75-c28dae361ad5

Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
…solute-ed

Fix model-level edfct derivatives for absolute ED type
Update NEWS.md with recent bug fixes for ED calculations
@hreinwald hreinwald merged commit 088301c into main_beta Apr 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants