Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Provide a default if the fatten param is missing in to_basic.GeomCrossbar() #2222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Close #2220: provide a default if the fatten param is missing in to_b…
…asic.GeomCrossbar
  • Loading branch information
cpsievert committed Jan 3, 2023
commit c104bfddc962686109d37a60af72ed923ae33143
2 changes: 1 addition & 1 deletion 2 R/layers2traces.R
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ to_basic.GeomCrossbar <- function(data, prestats_data, layout, params, p, ...) {
# from GeomCrossbar$draw_panel()
middle <- base::transform(data, x = xmin, xend = xmax, yend = y, alpha = NA)
nm <- linewidth_or_size(GeomCrossbar)
data[[nm]] <- data[[nm]] * params$fatten
data[[nm]] <- data[[nm]] * (params$fatten %||% formals(geom_crossbar)$fatten)
list(
prefix_class(to_basic.GeomRect(data), "GeomCrossbar"),
prefix_class(to_basic.GeomSegment(middle), "GeomCrossbar")
Expand Down
7 changes: 7 additions & 0 deletions 7 tests/testthat/test-ggplot-summary.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test_that("stat_summary works", {
p <- ggplot(iris, aes(x = Species, y = Sepal.Length)) +
stat_summary(fun = mean, fun.max = max, fun.min = min) +
stat_summary(fun = median, geom = "crossbar", linetype = "dashed")

expect_doppelganger_built(p, "stat-summary")
})
Morty Proxy This is a proxified and sanitized view of the page, visit original site.