Skip to content

Avoid error when using facet.args = list(free = TRUE) without facets#554

Merged
grantmcdermott merged 3 commits intomainfrom
issue553
Mar 23, 2026
Merged

Avoid error when using facet.args = list(free = TRUE) without facets#554
grantmcdermott merged 3 commits intomainfrom
issue553

Conversation

@zeileis
Copy link
Copy Markdown
Collaborator

@zeileis zeileis commented Feb 24, 2026

Fixes #553

In case of no facets, we should be able to just use the full data for xfree/yfree:

xfree = if (!is.null(facet)) split(c(x, xmin, xmax), facet)[[ii]] else c(x, xmin, xmax)
yfree = if (!is.null(facet)) split(c(y, ymin, ymax), facet)[[ii]] else c(y, ymin, ymax)

Then the following two yield equivalent output:

tinyplot(bill_len ~ bill_dep, data = penguins)
tinyplot(bill_len ~ bill_dep, data = penguins, facet.args = list(free = TRUE))

@grantmcdermott grantmcdermott merged commit c1f8452 into main Mar 23, 2026
3 checks passed
@grantmcdermott
Copy link
Copy Markdown
Owner

Nice and simple.Thanks!

@grantmcdermott grantmcdermott deleted the issue553 branch March 23, 2026 16: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.

Unhelpful error when facet = FALSE, facet.args = list(free = TRUE)

2 participants