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

autoplot: Error - must be data frame...not bench_mark/list #30

Closed
mkearney opened this issue Aug 12, 2018 · 1 comment
Closed

autoplot: Error - must be data frame...not bench_mark/list #30

mkearney opened this issue Aug 12, 2018 · 1 comment

Comments

@mkearney
Copy link

I'm getting an error about an object being a bench_mark/list and not a data.frame. The actual error message:

#> Error: Argument 1 must be a data frame or a named atomic vector, not a bench_mark/list

Here's a reproducible example although I'm getting the same error even when I try the package examples, so I imagine it has to be something related to my configuration (or maybe a recently introduced bug?).

## set seed
set.seed(20180812)

## generate data
d <- data.frame(x = rnorm(1000), y = 1:1000)

## create data frame with duplicate rows
d <- d[c(1:1000, sample(1:1000, 500, replace = TRUE)), ]
row.names(d) <- NULL

## bench mark
m <- bench::mark(uq = unique(d), dup = d[!duplicated(d), ])

## view results
m
#> # A tibble: 2 x 10
#>   expression    min  mean median    max `itr/sec` mem_alloc  n_gc n_itr
#>   <chr>      <bch:> <bch> <bch:> <bch:>     <dbl> <bch:byt> <dbl> <int>
#> 1 uq         1.76ms 2.2ms 2.03ms 4.01ms      455.     111KB    26   138
#> 2 dup        1.71ms 2.5ms 2.11ms 8.25ms      399.      93KB    12   148
#> # ... with 1 more variable: total_time <bch:tm>

## plot
ggplot2::autoplot(m)
#> Error: Argument 1 must be a data frame or a named atomic vector, not a bench_mark/list

Created on 2018-08-12 by the reprex package (v0.2.0.9000).

And here's the more detailed traceback:

#> 12: stop(list(message = "Argument 1 must be a data frame or a named atomic vector, not a bench_mark/list", 
#>         call = NULL, cppstack = NULL))
#> 11: bind_rows_(x, .id)
#> 10: .f(.x[[i]], ...)
#> 9: map(nest_types$dataframe %||% list(), dplyr::bind_rows, .id = .id)
#> 8: unnest.data.frame(object)
#> 7: NextMethod(.Generic)
#> 6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
#> 5: suppressWarnings(NextMethod(.Generic))
#> 4: unnest.bench_mark(object)
#> 3: tidyr::unnest(object)
#> 2: autoplot.bench_mark(m)
#> 1: ggplot2::autoplot(m)

And session info:

#> R version 3.5.1 (2018-07-02)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS High Sierra 10.13.6
#> 
#> Matrix products: default
#> BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/C
#> 
#> attached base packages:
#> [1] datasets  stats     graphics  grDevices utils     methods   base     
#> 
#> other attached packages:
#> [1] bindrcpp_0.2.2
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_0.12.18      bindr_0.1.1       plyr_1.8.4        compiler_3.5.1    pillar_1.3.0.9000
#>  [6] tools_3.5.1       digest_0.6.15     evaluate_0.11     tfse_0.3.12       memoise_1.1.0    
#> [11] tibble_1.4.2.9005 gtable_0.2.0      debugme_1.1.0     pkgconfig_2.0.1   rlang_0.2.1.9000 
#> [16] reprex_0.2.0.9000 bench_1.0.1       cli_1.0.0         rstudioapi_0.7    yaml_2.2.0       
#> [21] dplyr_0.7.99.9000 withr_2.1.2       stringr_1.3.1     httr_1.3.1        knitr_1.20       
#> [26] fs_1.2.5          devtools_1.13.6   tidyselect_0.2.4  rprojroot_1.3-2   grid_3.5.1       
#> [31] glue_1.3.0        R6_2.2.2          processx_3.1.0    fansi_0.2.3       profmem_0.5.0    
#> [36] rmarkdown_1.10    tidyr_0.8.1       purrr_0.2.5       callr_2.0.4       rdrop2_0.8.1     
#> [41] ggplot2_3.0.0     clipr_0.4.1       magrittr_1.5      whisker_0.3-2     scales_1.0.0     
#> [46] backports_1.1.2   htmltools_0.3.6   assertthat_0.2.0  colorspace_1.3-2  utf8_1.1.4       
#> [51] stringi_1.2.4     lazyeval_0.2.1    munsell_0.5.0     crayon_1.3.4     
@mkearney mkearney changed the title Autoplot error - must be data frame...not bench_mark/list autoplot: Error - must be data frame...not bench_mark/list Aug 12, 2018
@jimhester
Copy link
Member

It looks like you are using a devel version of dplyr, which might be the issue. I don't see this behavior with the release version of dplyr (0.7.6).

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

2 participants