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 in cross table in presence of NA #40

Closed
aravindhebbali opened this Issue Mar 17, 2018 · 0 comments

Comments

Projects
  
0.4.1
1 participant
@aravindhebbali
Member

aravindhebbali commented Mar 17, 2018

Error in the grand total displayed in ds_cross_table() in the presence of NA's.

library(descriptr)
mt <- mtcarz
mt[c(3, 6, 9, 12), c(2, 3, 5, 6, 8, 10)] <- NA
ds_cross_table(mt, gear, cyl)
#>     Cell Contents
#>  |---------------|
#>  |     Frequency |
#>  |       Percent |
#>  |       Row Pct |
#>  |       Col Pct |
#>  |---------------|
#> 
#>  Total Observations:  32 
#> 
#> ----------------------------------------------------------------------------
#> |              |                            cyl                            |
#> ----------------------------------------------------------------------------
#> |         gear |            4 |            6 |            8 |    Row Total |
#> ----------------------------------------------------------------------------
#> |            3 |            1 |            1 |           11 |           13 |
#> |              |        0.031 |        0.031 |        0.344 |              |
#> |              |         0.08 |         0.08 |         0.85 |         0.41 |
#> |              |         0.11 |         0.17 |         0.85 |              |
#> ----------------------------------------------------------------------------
#> |            4 |            6 |            4 |            0 |           10 |
#> |              |        0.188 |        0.125 |            0 |              |
#> |              |          0.6 |          0.4 |            0 |         0.31 |
#> |              |         0.67 |         0.67 |            0 |              |
#> ----------------------------------------------------------------------------
#> |            5 |            2 |            1 |            2 |            5 |
#> |              |        0.062 |        0.031 |        0.062 |              |
#> |              |          0.4 |          0.2 |          0.4 |         0.16 |
#> |              |         0.22 |         0.17 |         0.15 |              |
#> ----------------------------------------------------------------------------
#> | Column Total |            9 |            6 |           13 |           32 |
#> |              |        0.281 |        0.187 |        0.406 |              |
#> ----------------------------------------------------------------------------

@aravindhebbali aravindhebbali added the bug label Mar 17, 2018

@aravindhebbali aravindhebbali added this to the 0.4.1 milestone Mar 17, 2018

@aravindhebbali aravindhebbali self-assigned this Mar 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment