-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Default unit = "relative"
not accepted (anymore) in microbenchmark
#34
Comments
I just fell over this same issue. The workaround is straightforward, but having to explicitly all # This causes an error in recent versions
microbenchmark(TRUE, FALSE, unit="relative")
#> Error in match.arg(unit, values): 'arg' should be one of "nanoseconds", "ns", "microseconds", "us", "milliseconds", "ms", "seconds", "s", "secs", "time", "t", "frequency", "f", "hz", "khz", "mhz", "eps"
# This is the workaround
res <- microbenchmark(TRUE, FALSE)
print(res, unit="relative")
#> Unit: relative
#> expr min lq mean median uq max neval
#> TRUE 1.0 1 1.000000 1 1 1.00000 100
#> FALSE 1.5 1 5.661927 1 1 48.81356 100 |
Thanks for the report @tappek! And thanks for the bump @richierocks. I just pushed a branch with a potential fix. Please test and report back. Thank you both again! |
Hey @tappek and @richierocks, can you please let me know if this branch fixes the issue? |
Works for me! Thank you! |
Sorry for delayed response. Yes, this works. Thanks for the fix. |
The fix to joshuaulrich#20 did not account for `unit = "relative"`, which broke existing functionality. Fixes joshuaulrich#34.
This used to work
microbenchmark::microbenchmark(TRUE, FALSE, unit = "relative")
but in version 1.4.9 (and maybe the previous version) it errors with:
Could #20 and the associated commit 6533560 be the culprit?
Passing
unit = "relative"
directly to summary still works.The text was updated successfully, but these errors were encountered: