Skip to content

make tinyplot_add compatible with do.call(tinyplot)#504

Merged
grantmcdermott merged 4 commits intomainfrom
tinyplot_add_fix
Nov 19, 2025
Merged

make tinyplot_add compatible with do.call(tinyplot)#504
grantmcdermott merged 4 commits intomainfrom
tinyplot_add_fix

Conversation

@zeileis
Copy link
Copy Markdown
Collaborator

@zeileis zeileis commented Oct 6, 2025

Fixes #499

The .last_call of the tinyplot() generic is now determined by comparing the functions called in sys.calls() rather than their names as suggested by @FlorianSchwendinger.

This makes it compatible with usage in do.call() or when using a custom copy of the generic.

do.call(tinyplot, list(x = 1:5, y = sin(1:5)))
do.call(tinyplot_add, list(type = "h"))

myplot = tinyplot
myplot_add = tinyplot_add
myplot(x = 1:5, y = sin(1:5))
myplot_add(type = "h")
tinyplot-add

Copy link
Copy Markdown
Owner

@grantmcdermott grantmcdermott left a comment

Choose a reason for hiding this comment

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

Thanks @zeileis, this looks good to me. One minor nit and then we can can merge once #473 is shepherded through. (I want to wait for that, since it's a big change that will cause some adjustments across most of the codebase.)

Comment thread R/tinyplot.R Outdated
@grantmcdermott grantmcdermott merged commit 4b81142 into main Nov 19, 2025
3 checks passed
@grantmcdermott grantmcdermott deleted the tinyplot_add_fix branch November 19, 2025 18:35
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.

do.call tinyplot_add

2 participants