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

Error: index out of bounds with dplyr groupped data #851

Closed
artemklevtsov opened this issue Oct 7, 2014 · 2 comments
Closed

Error: index out of bounds with dplyr groupped data #851

artemklevtsov opened this issue Oct 7, 2014 · 2 comments
Labels
bug Bugs
Milestone

Comments

@artemklevtsov
Copy link

Hi.

I have some problems with kable function with dplyr output. Example code.

library(dplyr)
library(psych)
library(knitr)

res <- mtcars %>%
    group_by(cyl) %>%
    do(describe(.$disp)) %>%
    select(-vars)
res
#> Source: local data frame [3 x 13]
#> Groups: cyl
#> 
#>   cyl  n  mean    sd median trimmed   mad   min   max range   skew kurtosis     se
#> 1   4 11 105.1 26.87  108.0   104.3 43.00  71.1 146.7  75.6 0.1206   -1.635  8.102
#> 2   6  7 183.3 41.56  167.6   183.3 11.27 145.0 258.0 113.0 0.7953   -1.229 15.709
#? 3   8 14 353.1 67.77  350.5   349.6 73.39 275.8 472.0 196.2 0.4529   -1.259 18.113
kable(res)
#> Error: index out of bounds
kable(as.data.frame(res))
#> | cyl|  n|  mean|    sd| median| trimmed|   mad|   min|   max| range|   skew| kurtosis|     se|
#> |---:|--:|-----:|-----:|------:|-------:|-----:|-----:|-----:|-----:|------:|--------:|------:|
#> |   4| 11| 105.1| 26.87|  108.0|   104.3| 43.00|  71.1| 146.7|  75.6| 0.1206|   -1.635|  8.102|
#> |   6|  7| 183.3| 41.56|  167.6|   183.3| 11.27| 145.0| 258.0| 113.0| 0.7953|   -1.229| 15.709|
#> |   8| 14| 353.1| 67.77|  350.5|   349.6| 73.39| 275.8| 472.0| 196.2| 0.4529|   -1.259| 18.113|
packageVersion('dplyr')
#> [1] ‘0.3.0.1’
packageVersion('knitr')
#> [1] ‘1.6.18’

Thanks.

@yihui yihui added the bug Bugs label Oct 11, 2014
@yihui yihui added this to the v1.7 milestone Oct 11, 2014
@yihui yihui closed this as completed in e34c279 Oct 12, 2014
@yihui
Copy link
Owner

yihui commented Oct 12, 2014

Should be fixed now. Thanks!

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs
Projects
None yet
Development

No branches or pull requests

2 participants