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

make sure catto_onehot and catto_dummy can return tibbles #8

Closed
bfgray3 opened this issue Jan 23, 2018 · 3 comments
Closed

make sure catto_onehot and catto_dummy can return tibbles #8

bfgray3 opened this issue Jan 23, 2018 · 3 comments
Assignees
Labels

Comments

@bfgray3
Copy link
Owner

bfgray3 commented Jan 23, 2018

No description provided.

@bfgray3 bfgray3 self-assigned this Jan 23, 2018
@bfgray3
Copy link
Owner Author

bfgray3 commented Jan 28, 2018

see tidyverse/tibble#85. need to use dplyr::bind_cols instead of cbind.

@bfgray3
Copy link
Owner Author

bfgray3 commented Jan 28, 2018

> tt <- as_tibble(matrix(rnorm(100000000), 1000, 1000))
> tt1 <- setNames(tt, paste0("a", seq_along(tt)))
> microbenchmark(as_tibble(cbind(tt, tt1)), bind_cols(tt, tt1), cbind(tt, tt1))
Unit: microseconds
                      expr       min        lq       mean    median         uq       max neval
 as_tibble(cbind(tt, tt1)) 42601.759 43343.209 45215.8420 44681.185 46374.0805 56323.098   100
        bind_cols(tt, tt1)  2005.939  2131.156  2280.5585  2262.736  2377.6900  3424.382   100
            cbind(tt, tt1)   174.894   214.717   258.5104   261.109   294.9795   527.145   100

@bfgray3
Copy link
Owner Author

bfgray3 commented Jan 28, 2018

> tt <- matrix(rnorm(100000000), 1000, 1000, dimnames = list(1:1000, paste0("a", 1:1000)))
> ttt <- setNames(as_tibble(tt), paste0("a", colnames(tt)))
> microbenchmark(bind_cols(ttt, as.data.frame(tt)), bind_cols(ttt, as_tibble(tt)), as_tibble(cbind(ttt, tt)))
Unit: milliseconds
                              expr      min       lq     mean   median       uq       max neval
 bind_cols(ttt, as.data.frame(tt)) 19.65335 20.29894 21.33746 20.59145 21.07159  30.03858   100
     bind_cols(ttt, as_tibble(tt)) 23.01287 23.80953 26.87130 24.88373 27.52520 118.07529   100
         as_tibble(cbind(ttt, tt)) 54.55569 58.66774 60.21169 59.58778 60.90112  71.97607   100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant