Skip to content
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

supply more informative axis breaks in scale_*_bench_*() #144

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

simonpcouch
Copy link

Closes #143. I believe that these breaks functions, passed by position, were intended to be passed to scales::trans_new(breaks) rather than scales::trans_new(d_transform).

Here's the reprex from the original issue:

library(ggplot2)
library(bench)

create_df <- function(rows, cols) {
  as.data.frame(setNames(
    replicate(cols, runif(rows, 1, 1000), simplify = FALSE),
    rep_len(c("x", letters), cols)))
}

# Run 4 data sizes across 3 samples with 2 replicates (24 total benchmarks)
bm <- press(
  rows = c(1000, 10000),
  cols = c(10, 100),
  rep = 1:2,
  {
    dat <- create_df(rows, cols)
    bench::mark(
      min_time = .05,
      bracket = dat[dat$x > 500, ],
      which = dat[which(dat$x > 500), ],
      subset = subset(dat, x > 500)
    )
  }
)
#> Running with:
#>    rows  cols   rep
#> 1  1000    10     1
#> 2 10000    10     1
#> 3  1000   100     1
#> 4 10000   100     1
#> 5  1000    10     2
#> 6 10000    10     2
#> 7  1000   100     2
#> 8 10000   100     2

ggplot(bm) + aes(x = median, y = mem_alloc) + geom_point()
#> Warning: The `trans` argument of `continuous_scale()` is deprecated as of ggplot2 3.5.0.
#> ℹ Please use the `transform` argument instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

Created on 2024-07-15 with reprex v2.1.0

@simonpcouch
Copy link
Author

Hey @DavisVaughan—could I work with you get this PR and #141 up to snuff and out on CRAN?

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.

scale_*_bench_*() functions obscure lower values
1 participant