Skip to content

Refactor R functions, enhance README, and update documentation#47

Open
hreinwald wants to merge 734 commits intoDoseResponse:masterfrom
hreinwald:main_beta
Open

Refactor R functions, enhance README, and update documentation#47
hreinwald wants to merge 734 commits intoDoseResponse:masterfrom
hreinwald:main_beta

Conversation

@hreinwald
Copy link
Copy Markdown

This pull request introduces a comprehensive update to the package, including new model functions, improvements to documentation, expanded export/imports, and updates to package metadata. The main themes are: expanding dose-response modeling capabilities, improving documentation and usability, updating package infrastructure, and enhancing compatibility with modern R standards.

Dose-response modeling enhancements:

  • Added new model functions such as CRS.6 (generalized Cedergreen-Ritz-Streibig model for hormesis), additional variants for Cedergreen models, and new helper/model functions for effective dose calculations (ED.drc, ED.lin, EDhelper) and relative potency comparisons (EDcomp, fieller, splitInd, createsifct). All new functions are documented with roxygen comments for clarity and usability. [1] [2] [3] [4] [5] [6] [7] [8]

  • Expanded the list of exported functions in NAMESPACE to include new and previously unexported models and utilities, improving accessibility for users.

Documentation and usability improvements:

  • Added comprehensive roxygen documentation to new and existing functions, including detailed descriptions, parameter explanations, references, examples, and usage notes. This improves discoverability and ease of use for both new and experienced users. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Package infrastructure and compatibility:

  • Updated DESCRIPTION for new version (3.3.0), new author, modern R dependency (>=4.0.0), updated URLs, encoding, roxygen version, testthat configuration, and additional suggested packages.

  • Improved .Rbuildignore to exclude more files and folders, and removed .travis.yml for modern CI compatibility. [1] [2]

Namespace and S3 methods updates:

  • Added new S3 methods for mrdrc class and additional confint, plot, print, ED methods, and improved imports for graphics, MASS, sandwich, lifecycle, and utils.

These changes collectively modernize the package, expand its modeling capabilities, and improve its usability and maintainability for dose-response analysis in R.

Copy link
Copy Markdown

@eduardszoecs eduardszoecs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 100 files

Comment thread README.Rmd Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed? I'd keep it (or a qmd) to render the README.md from this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to make the whole repo a slick a possible for a clean start. As the previous README.Rmd did not contain any crucial content I decided to simply strip that away and write a clean simple Markdown from the start. Feel free to add a .Rmd or .qmd version to the repo. 👍

Comment thread R/genRetFct.R Outdated
#' @keywords internal
"genRetFct" <- function(fct, parmVec, notFixed)
{
# ## Defining the model function adjusted for scaling
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function can be dropped?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted! Absolutely! Will do :) Thx 👍

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 🐱

Comment thread R/iband.R Outdated
#' @title Confidence band calculation
#' @keywords internal
"iband" <- function(object)
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intendation

Comment thread R/max.r
@@ -1,33 +0,0 @@
"MAX" <- function(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed? Not needed or unused?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this function and enhanced its documentation. See here

Comment thread R/mselect.R
@@ -19,7 +64,7 @@ function(object, fctList = NULL, nested = FALSE, sorted = c("IC", "Res var", "La

retMat[1 ,1] <- logLik(object)
retMat[1, 2] <- icfct(object) # AIC(object)
if (nested) {retMat[1, 3] <- modelFit(object)[2, 5]}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason?

Comment thread R/noEffect.R

if (identical(object$"type", "Poisson"))
{
llNull <- logLik(glm(resp ~ 1, family = poisson))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did that work before?

Comment thread R/noEffect.R
if (identical(object$"type", "Poisson"))
{
llNull <- logLik(glm(resp ~ 1, family = poisson))
respVec <- object$"dataList"$resp
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is triplicated and can be moved outside of the ifs()

@eduardszoecs
Copy link
Copy Markdown

I think this PR is not reviewable (too many changes) and suggest a fork?

@eduardszoecs
Copy link
Copy Markdown

Although I do not think this is the case here: Such massive PRs are also a gateway for possible exploits.

For example there are many hard-coded links to an external repo which can hide anything: repo:hreinwald/drc https://github.com/hreinwald/drc/blob/HEAD...

Moreover there are changes to .rda files , which can hide exploits: https://github.com/hrbrmstr/rdaradar

@eduardszoecs
Copy link
Copy Markdown

Instead of a separate fork,you could also split this up into separate, smaller & meaningful PR (by topic).

Copilot AI and others added 25 commits March 18, 2026 16:21
…rage

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

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

Add test suite for getInitial achieving 100% coverage
…unctions

Add test suite for backfit() achieving 100% code coverage
Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
…erage

Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Correct the formatting of documentation links in README.
…unctions

Add test suite for noEffect function with 100% coverage
…on-necessity

Add tests for searchdrc function
…p dead code, fix bugs

Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Copilot AI and others added 30 commits April 8, 2026 06:31
Agent-Logs-Url: https://github.com/hreinwald/drc/sessions/8b86502a-db64-4ab8-83e9-9ee71fc293f7

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

Fix predict.drc() error with models having multiple fixed parameters
Fix bugs, enhance tests, and clean up R source files
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
Enhance error bar colors and update to version 3.3.1
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.

5 participants