Convert do.call calls to ParmOff#16
Conversation
…gtri Agent-Logs-Url: https://github.com/asgr/magicaxis/sessions/b1365e3a-b831-4f58-913b-b006daa3c6c6 Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
asgr
left a comment
There was a problem hiding this comment.
Add relevant unit tests and create a long form vignette magicaxis.Rmd that uses fig.width and fig.height of 6.
Agent-Logs-Url: https://github.com/asgr/magicaxis/sessions/e8cd5243-668b-401a-936b-63f792e6d411 Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
Done in 523981a. Added:
Also updated |
… ways to envoke magaxis inside magplot since there are subtle issues with argument clashes.
Replaces all
do.callcalls across the package withParmOff::ParmOff, and improves argument routing inmagtriso that...is forwarded tomagaxis,magcon, andpointsinstead of onlymagcon.Changes
Package infrastructure
ParmOfftoImportsinDESCRIPTIONwith aRemotes: asgr/ParmOffentryimportFrom("ParmOff", "ParmOff")toNAMESPACEtestthat (>= 3.0.0),knitr, andrmarkdowntoSuggestsVignetteBuilder: knitrandConfig/testthat/edition: 31-to-1
do.call→ParmOffreplacements (no behaviour change)magaxis.R—axis(×6) andmtext(×2) callsmagplot.R—maghist,magmap,points,magbarcallsmagbin.R—magmap(×3),magplot(×2),magbarcallsmagimage.R—imagecallmagimageRGB.R—imagecallmagtri.R— the main improvementPreviously, all
...passed tomagtri()were forwarded exclusively tomagcon. Now adots = list(...)is collected once and routed viaParmOffto every sub-function call:magaxis(…)(all panels)...magcon(…)......(ParmOff deduplicates)points(…)...This means callers can now do things like:
ParmOff's argument merging ensures user-supplied values override the defaults while avoiding duplicate-argument errors that the old
do.call(func, c(list(fixed), dots))pattern would throw.Tests and vignette
tests/testthat/test-parmoff-routing.Rwith 15 unit tests covering ParmOff argument routing throughmagaxis,magplot,magmap,magbin/plot.magbin,magimage, andmagtri(including forwardingcex.axis→magaxis,lty→magcon,pch→points).vignettes/magicaxis.Rmd, a long-form vignette withfig.width = 6/fig.height = 6throughout, coveringmagaxis,magplot,maghist,magcon,magbin,magimage, andmagtri; includes a dedicated section demonstrating the new ParmOff-based argument routing inmagtri.