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

Multiple two way tables returns error #4

Closed
aravindhebbali opened this Issue Aug 28, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@aravindhebbali
Member

aravindhebbali commented Aug 28, 2017

tway_tables() returns the following error:

> ecom <- readr::read_csv('https://raw.githubusercontent.com/rsquaredacademy/datasets/master/web.csv', 
+   col_types = list(col_integer(), 
+   col_factor(levels = c('bing', 'direct', 'google', 'social', 'yahoo')), 
+   col_factor(levels = c('tablet', 'laptop', 'mobile')), 
+   col_factor(levels = c('true', 'false')), col_integer(), col_double(), 
+   col_double(), col_character(), col_factor(levels = c('true', 'false')), 
+   col_double(), col_double())            
+ )
> tway_tables(ecom)
    Cell Contents
 |---------------|
 |     Frequency |
 |       Percent |
 |       Row Pct |
 |       Col Pct |
 |---------------|

 Total Observations:  1000 

Error in sort.list(y) : 'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?
Called from: sort.list(y)

Session Info

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252   
[3] LC_MONETARY=English_India.1252 LC_NUMERIC=C                  
[5] LC_TIME=English_India.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] descriptr_0.1.1 readr_1.1.1     dplyr_0.7.2     bindrcpp_0.2   

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.11         learnr_0.9           compiler_3.4.1      
 [4] git2r_0.15.0         bindr_0.1            tools_3.4.1         
 [7] digest_0.6.10        jsonlite_1.5         evaluate_0.10       
[10] memoise_1.0.0.9001   tibble_1.3.4         pkgconfig_2.0.1     
[13] rlang_0.1.2          rstudioapi_0.6       shiny_1.0.4         
[16] curl_2.2             yaml_2.1.14          withr_1.0.2         
[19] stringr_1.2.0        httr_1.3.1           knitr_1.17          
[22] hms_0.2              htmlwidgets_0.9      devtools_1.13.3     
[25] tidyselect_0.1.1     rprojroot_1.2-10     glue_1.1.1          
[28] R6_2.2.2             rmarkdown_1.6        tidyr_0.7.0         
[31] purrr_0.2.3          skimr_0.9000         magrittr_1.5        
[34] backports_1.0.4      htmltools_0.3.6      colformat_0.0.0.9000
[37] rsconnect_0.8.5      assertthat_0.2.0     mime_0.5            
[40] xtable_1.8-0         httpuv_1.3.5         stringi_1.1.2       
[43] crayon_1.3.2.9000    markdown_0.8

@aravindhebbali aravindhebbali added the bug label Aug 28, 2017

@aravindhebbali aravindhebbali self-assigned this Aug 28, 2017

@aravindhebbali

This comment has been minimized.

Member

aravindhebbali commented Sep 3, 2017

> tway_tables(ecom)
    Cell Contents
 |---------------|
 |     Frequency |
 |       Percent |
 |       Row Pct |
 |       Col Pct |
 |---------------|

 Total Observations:  1000 

                            referrer vs device                              
----------------------------------------------------------------------------
|              |                          device                           |
----------------------------------------------------------------------------
|     referrer |       tablet |       laptop |       mobile |    Row Total |
----------------------------------------------------------------------------
|         bing |           69 |           59 |           66 |          194 |
|              |        0.069 |        0.059 |        0.066 |              |
|              |         0.36 |          0.3 |         0.34 |         0.19 |
|              |         0.21 |         0.18 |         0.19 |              |
----------------------------------------------------------------------------
|       direct |           57 |           70 |           64 |          191 |
|              |        0.057 |         0.07 |        0.064 |              |
|              |          0.3 |         0.37 |         0.34 |         0.19 |
|              |         0.17 |         0.22 |         0.19 |              |
----------------------------------------------------------------------------
|       google |           67 |           63 |           78 |          208 |
|              |        0.067 |        0.063 |        0.078 |              |
|              |         0.32 |          0.3 |         0.38 |         0.21 |
|              |          0.2 |         0.19 |         0.23 |              |
----------------------------------------------------------------------------
|       social |           73 |           70 |           57 |          200 |
|              |        0.073 |         0.07 |        0.057 |              |
|              |         0.36 |         0.35 |         0.28 |          0.2 |
|              |         0.22 |         0.22 |         0.17 |              |
----------------------------------------------------------------------------
|        yahoo |           65 |           63 |           79 |          207 |
|              |        0.065 |        0.063 |        0.079 |              |
|              |         0.31 |          0.3 |         0.38 |         0.21 |
|              |          0.2 |         0.19 |         0.23 |              |
----------------------------------------------------------------------------
| Column Total |          331 |          325 |          344 |         1000 |
|              |        0.331 |        0.325 |        0.344 |              |
----------------------------------------------------------------------------


                    referrer vs bouncers                     
-------------------------------------------------------------
|              |                  bouncers                  |
-------------------------------------------------------------
|     referrer |         true |        false |    Row Total |
-------------------------------------------------------------
|         bing |           90 |          104 |          194 |
|              |         0.09 |        0.104 |              |
|              |         0.46 |         0.54 |         0.19 |
|              |         0.18 |         0.21 |              |
-------------------------------------------------------------
|       direct |           93 |           98 |          191 |
|              |        0.093 |        0.098 |              |
|              |         0.49 |         0.51 |         0.19 |
|              |         0.19 |         0.19 |              |
-------------------------------------------------------------
|       google |          107 |          101 |          208 |
|              |        0.107 |        0.101 |              |
|              |         0.51 |         0.49 |         0.21 |
|              |         0.22 |          0.2 |              |
-------------------------------------------------------------
|       social |          107 |           93 |          200 |
|              |        0.107 |        0.093 |              |
|              |         0.54 |         0.46 |          0.2 |
|              |         0.22 |         0.18 |              |
-------------------------------------------------------------
|        yahoo |           97 |          110 |          207 |
|              |        0.097 |         0.11 |              |
|              |         0.47 |         0.53 |         0.21 |
|              |          0.2 |         0.22 |              |
-------------------------------------------------------------
| Column Total |          494 |          506 |         1000 |
|              |        0.494 |        0.506 |              |
-------------------------------------------------------------


                    referrer vs purchase                     
-------------------------------------------------------------
|              |                  purchase                  |
-------------------------------------------------------------
|     referrer |         true |        false |    Row Total |
-------------------------------------------------------------
|         bing |           17 |          177 |          194 |
|              |        0.017 |        0.177 |              |
|              |         0.09 |         0.91 |         0.19 |
|              |         0.17 |          0.2 |              |
-------------------------------------------------------------
|       direct |           25 |          166 |          191 |
|              |        0.025 |        0.166 |              |
|              |         0.13 |         0.87 |         0.19 |
|              |         0.24 |         0.19 |              |
-------------------------------------------------------------
|       google |           19 |          189 |          208 |
|              |        0.019 |        0.189 |              |
|              |         0.09 |         0.91 |         0.21 |
|              |         0.18 |         0.21 |              |
-------------------------------------------------------------
|       social |           20 |          180 |          200 |
|              |         0.02 |         0.18 |              |
|              |          0.1 |          0.9 |          0.2 |
|              |         0.19 |          0.2 |              |
-------------------------------------------------------------
|        yahoo |           22 |          185 |          207 |
|              |        0.022 |        0.185 |              |
|              |         0.11 |         0.89 |         0.21 |
|              |         0.21 |         0.21 |              |
-------------------------------------------------------------
| Column Total |          103 |          897 |         1000 |
|              |        0.103 |        0.897 |              |
-------------------------------------------------------------


                     device vs bouncers                      
-------------------------------------------------------------
|              |                  bouncers                  |
-------------------------------------------------------------
|       device |         true |        false |    Row Total |
-------------------------------------------------------------
|       tablet |          158 |          173 |          331 |
|              |        0.158 |        0.173 |              |
|              |         0.48 |         0.52 |         0.33 |
|              |         0.32 |         0.34 |              |
-------------------------------------------------------------
|       laptop |          176 |          149 |          325 |
|              |        0.176 |        0.149 |              |
|              |         0.54 |         0.46 |         0.32 |
|              |         0.36 |         0.29 |              |
-------------------------------------------------------------
|       mobile |          160 |          184 |          344 |
|              |         0.16 |        0.184 |              |
|              |         0.47 |         0.53 |         0.34 |
|              |         0.32 |         0.36 |              |
-------------------------------------------------------------
| Column Total |          494 |          506 |         1000 |
|              |        0.494 |        0.506 |              |
-------------------------------------------------------------


                     device vs purchase                      
-------------------------------------------------------------
|              |                  purchase                  |
-------------------------------------------------------------
|       device |         true |        false |    Row Total |
-------------------------------------------------------------
|       tablet |           36 |          295 |          331 |
|              |        0.036 |        0.295 |              |
|              |         0.11 |         0.89 |         0.33 |
|              |         0.35 |         0.33 |              |
-------------------------------------------------------------
|       laptop |           31 |          294 |          325 |
|              |        0.031 |        0.294 |              |
|              |          0.1 |          0.9 |         0.32 |
|              |          0.3 |         0.33 |              |
-------------------------------------------------------------
|       mobile |           36 |          308 |          344 |
|              |        0.036 |        0.308 |              |
|              |          0.1 |          0.9 |         0.34 |
|              |         0.35 |         0.34 |              |
-------------------------------------------------------------
| Column Total |          103 |          897 |         1000 |
|              |        0.103 |        0.897 |              |
-------------------------------------------------------------


                    bouncers vs purchase                     
-------------------------------------------------------------
|              |                  purchase                  |
-------------------------------------------------------------
|     bouncers |         true |        false |    Row Total |
-------------------------------------------------------------
|         true |            0 |          494 |          494 |
|              |            0 |        0.494 |              |
|              |            0 |            1 |         0.49 |
|              |            0 |         0.55 |              |
-------------------------------------------------------------
|        false |          103 |          403 |          506 |
|              |        0.103 |        0.403 |              |
|              |          0.2 |          0.8 |         0.51 |
|              |            1 |         0.45 |              |
-------------------------------------------------------------
| Column Total |          103 |          897 |         1000 |
|              |        0.103 |        0.897 |              |
-------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment