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

press() varies format of .grid values depending on whether .grid is a tbl_df or data.frame #142

Open
simonpcouch opened this issue Jul 2, 2024 · 0 comments

Comments

@simonpcouch
Copy link

I had expected to be able to access x inside of the expression in the same way regardless of whether .grid was a tbl_df or data.frame, but for the former, I'd need to write x$x to match the format of the latter:

library(tibble)

bench::press({print(x); bench::mark()}, .grid = tibble(x = 1))
#> Running with:
#>       x
#> 1     1
#> # A tibble: 1 × 1
#>       x
#>   <dbl>
#> 1     1
#> # A tibble: 0 × 7
#> # ℹ 7 variables: expression <bch:expr>, x <dbl>, min <bch:tm>, median <bch:tm>,
#> #   itr/sec <dbl>, mem_alloc <bch:byt>, gc/sec <dbl>

bench::press({print(x); bench::mark()}, .grid = data.frame(x = 1))
#> Running with:
#>       x
#> 1     1
#> [1] 1
#> # A tibble: 0 × 7
#> # ℹ 7 variables: expression <bch:expr>, x <dbl>, min <bch:tm>, median <bch:tm>,
#> #   itr/sec <dbl>, mem_alloc <bch:byt>, gc/sec <dbl>

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

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

No branches or pull requests

1 participant