Initial launch of refactoring R functions, update README, and remove obsolete files#46
Open
hreinwald wants to merge 50 commits intoDoseResponse:masterfrom
Open
Initial launch of refactoring R functions, update README, and remove obsolete files#46hreinwald wants to merge 50 commits intoDoseResponse:masterfrom
hreinwald wants to merge 50 commits intoDoseResponse:masterfrom
Conversation
- README.md: Complete rewrite with package overview, installation, quick start examples, available models, key functions, and supported data types - drmEMstandard.R: Remove active print() debug statements in opfct() and remove dead if(FALSE) code block (~170 lines of experimental scratch code) - findbe.r: Remove active print(c(bVal, eVal)) debug statement in findbe2() - llogistic.ssf.R: Remove dead if(FALSE) code block (~200 lines of stale logic) - searchdrc.R: Fix unsafe options(warn=-1) usage with on.exit() for guaranteed warning state restoration - noEffect.R: Fix unscoped variable reference 'resp' in Poisson branch - rdrm.r: Replace eval(parse(text=...)) code injection with match.fun/do.call Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
…or-functions Add comprehensive README and refactor poorly coded R functions
The /tests folder contained ad-hoc scripts from 2007-2009 that were development artifacts, not proper package tests: - No testing framework (no testthat, no RUnit) - No assertions or expected output comparisons - seedGerminationMods.R was 100% commented out - test2.r was mostly commented out since May 2009 - Old commented-out Windows absolute paths - No other package files reference the tests/ folder Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
…lder Remove /tests folder (development artifacts)
Can be safely removed. Not needed for the package dev
… remove redundant reference files Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Update .gitignore and .Rbuildignore with standard R package settings
…md, _pkgdown.yml Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Remove obsolete base-level files
First dev merge to main
Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
…ws-file Add news file entry summarizing all fork changes from upstream
Summarize all fork changes in news file
…s, add missing Imports Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
…pace-files Fix DESCRIPTION format: add Encoding, fix Authors@R, remove deprecated fields
…>'e2' in ursa, 'contain'->'contents' in EDcomp, 'mising'->'missing' and 'reponses'->'responses' in drm.Rd, 'reponse'->'response' in CRS.5a.Rd Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
Add roxygen2 comment blocks before the function definitions in drm() and drmc(), based on the existing hand-written .Rd man pages. Only comments are added; no function code is modified. No @export tags are included since the package uses a hand-written NAMESPACE file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 headers (#' comments) before function definitions in four R source files based on their corresponding .Rd man pages: - R/ED.drc.R: ED generic and ED.drc method with full param/details docs - R/EDcomp.R: EDcomp with full docs; fieller, splitInd, createsifct marked as @Keywords internal - R/compParm.R: compParm with full param/return/examples docs - R/comped.r: comped with full param/return/examples docs No @export tags added. No function code modified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 headers (#' comments) before function definitions in: - plot.drc.R: main plot.drc function with full param/details/examples - predict.drc.R: predict.drc function - summary.drc.R: summary.drc function - anova.drc.R: main anova.drc function - coef.drc.R: coef.drc function - confint.drc.R: confint.drc function - fitted.drc.R: fitted.drc function - residuals.drc.R: residuals.drc function - logLik.drc.R: logLik.drc function - vcov.drc.R: main vcov.drc function Documentation derived from corresponding .Rd man pages. No @export tags added. Function code unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 headers (#' comments) before function definitions in: - update.drc.R: update.drc function - print.drc.R: print.drc function - print.summary.drc.R: print.summary.drc function - hatvalues.drc.R: hatvalues.drc function - cooks.distance.drc.R: cooks.distance.drc function (undocumented) - boxcox.drc.R: boxcox.drc main function only - sandwich.r: estfun.drc and bread.drc functions - modelFit.R: modelFit function only - mselect.r: mselect function - noEffect.R: noEffect function Documentation derived from corresponding .Rd man pages. No @export tags added. No function code modified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 documentation for all 13 functions in llogistic.R: - llogistic: main 5-parameter log-logistic function - LL.2, LL.3, LL.3u, LL.4, LL.5: convenience wrappers - l2, l3, l3u, l4, l5: aliases using @Rdname - MM.2, MM.3: Michaelis-Menten functions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 documentation blocks for all 9 functions in llogistic2.R: - llogistic2: main 5-parameter log-logistic with log(ED50) - lowupFixed, lowFixed, upFixed: internal helper functions - LL2.2, LL2.3, LL2.3u, LL2.4, LL2.5: convenience wrappers Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 documentation for logistic, L.3, L.4, and L.5 functions including parameter descriptions, return values, cross-references, keywords, and examples. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 documentation blocks for all 10 functions in weibull1.r: weibull1, W1.2, w2, W1.3, w3, W1.3u, W1.4, w4, EXD.2, and EXD.3. Alias functions (w2, w3, w4) use @Rdname to link to their parent documentation. No @export tags added. No function code modified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 doc blocks for all 7 functions: weibull2, W2.2, W2.3, W2.3u, W2.4, AR.2, and AR.3. No function code was modified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 documentation for weibull2x, W2x.3, and W2x.4 functions including parameter descriptions, return values, cross-references, examples, and keywords. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 headers to 10 R source files containing dose-response model functions: lnormal, gaussian, lgaussian, gompertz, gompertzd, braincousens, cedergreen, ucedergreen, NEC, and fplogistic, along with all their convenience functions and aliases. Documentation derived from corresponding .Rd man pages. Only #' comment headers added before function definitions; no function code modified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 headers to arandaordaz/AR.2/AR.3, baro5, gammadr, multi2, twophase, threephase, ursa, CRS.6, hewlett, and voelund functions. Documentation is based on existing .Rd man pages where available, and on code analysis for files without man pages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add roxygen2 #' comment headers before function definitions in: - backfit.r, lin.test.R, neill.test.R, mr.test.R, searchdrc.R - simDR.R, rdrm.r, isobole.r, mixture.r, maED.R Documentation derived from corresponding .Rd man pages. No function code was modified. No @export tags added. Internal helper neill.default marked with @Keywords internal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Added #' roxygen2 comments before function definitions in: - yieldLoss.R (yieldLoss) - relpot.r (relpot) - CIcompX.R (CIcompX, CIcomp, plotFACI) - getMeanFunctions.R (getMeanFunctions) - getInitial.R (getInitial) - max.r (MAX) - pr.r (PR) - Rsq.R (Rsq) - absToRel.R (absToRel) with @Keywords internal - simFct.R (simFct) Documentation derived from existing .Rd man pages where available, and from code analysis for files without man pages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tation Every R source file in /R lacked roxygen2 documentation. This PR adds #' headers to all functions and fixes several typos/bugs discovered during review. Bug fix ursa.r / ursa.Rd: Duplicate parameter name "e1" → "e2" — the 6th element was a copy-paste error Typo fixes gaussian.r, lgaussian.R: "insted" → "instead" EDcomp.R: "contain" → "contents" man/drm.Rd: "mising" → "missing", "reponses" → "responses" man/CRS.5a.Rd: "reponse" → "response" Roxygen2 documentation added Core API (drm, drmc): Full @param, @return, @details, @examples ED estimation (ED, EDcomp, compParm, comped): Comprehensive docs with CI method details S3 methods (plot, predict, summary, coef, confint, anova, fitted, residuals, logLik, vcov, update, print, hatvalues, cooks.distance, boxcox): Standard method docs Model functions (~50 functions across llogistic, logistic, weibull, lnormal, gaussian, gompertz, braincousens, cedergreen, nec, fplogistic, arandaordaz, baro5, gammadr, multi2, etc.): Docs for main functions and all convenience wrappers (e.g. LL.4, W1.4, BC.5) Testing/utility (modelFit, mselect, noEffect, backfit, lin.test, neill.test, mr.test, searchdrc, simDR, rdrm, isobole, mixture, maED, yieldLoss, etc.) Self-starters & internals (44 files): Minimal @title + @Keywords internal No function code was modified — all changes are roxygen2 comment additions and typo corrections.
…l measurement check, remove unused variables - Remove ~913 lines of commented-out code (dead code, debug prints, old implementations) - Fix bug: move stop() for separate+control measurements outside if(!noMessage) block - Remove unused variable isfi (defined but never used) - Remove redundant variable lenData (identical to numObs) - Remove dead first pmodelsList2 loop (cm is always NULL, second loop always overwrites) - Replace lenData with numObs in modelFunction and drmEMssd calls Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
The drm() and drmc() core functions were reviewed for bugs, instabilities, and unnecessary code. drmc() is clean. drm() had ~900 lines of commented-out dead code and one bug.
Bug fix
The stop() preventing separate=TRUE with control measurements was nested inside if (!noMessage), so drmc(noMessage=TRUE) silently bypassed it:
# Before (bug): stop() skipped when noMessage=TRUE
if (!noMessage) {
cat(...)
if (separate) stop(...)
}
# After (fixed): message is conditional, safety check is not
if (!noMessage) {
cat(...)
}
if (separate) stop(...)
Dead code removal (~913 lines)
Commented-out code blocks: Old ANOVA models, Box-Cox routines, variance power models, fctList handling, scaling routines, abandoned alternatives, debug print() statements
Unused variable isfi: Defined as is.finite(dose) but never referenced (usage commented out since 2010)
Redundant variable lenData: Identical to numObs at point of definition; replaced all uses with numObs
Dead pmodelsList2 first loop: cm is unconditionally set to NULL after control measurement detection, making the first loop (guarded by !is.null(cm)) dead code. The second loop overwrites all its results regardless.
Add roxygen2 documentation and fix typos in R source files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request primarily focuses on code cleanup and modernization, with the removal of legacy or unused code, refactoring for better readability and maintainability, and minor bug fixes. It also updates project configuration files to better align with current practices.
Project configuration and cleanup:
.travis.ymlfile and added it, along with several other project and documentation files, to.Rbuildignoreto prevent them from being included in package builds. [1] [2]README.Rmdfile, which contained installation and overview instructions, likely in favor of other documentation practices.Code cleanup and removal of unused code:
R/drmEMstandard.RandR/llogistic.ssf.R, significantly reducing clutter and improving maintainability. [1] [2]Refactoring and minor bug fixes:
eval(parse(...))with safer and more idiomatic R constructs likedo.call()andmatch.fun()inR/rdrm.r, improving code safety and readability. [1] [2] [3] [4]R/noEffect.Rwhere the Poisson null model was incorrectly specified, now explicitly extracting the response vector before fitting the model.R/searchdrc.Rby saving and restoring the original warning option, ensuring that global warning settings are not inadvertently changed.print()statements from several functions for cleaner output. [1] [2]