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 one way table returns an error #2

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

Comments

Projects
None yet
1 participant
@aravindhebbali
Member

aravindhebbali commented Aug 28, 2017

oway_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())            
+ )
> oway_tables(ecom)
Error in freq_table2.default(factors.df[, i], nam[i]) : 
  (list) object cannot be coerced to type 'double'
Called from: freq_table2.default(factors.df[, i], nam[i])

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

> oway_tables(ecom)
                             Variable: referrer                              
|--------------------------------------------------------------------------|
|                                Cumulative                    Cumulative  |
|    Levels    |  Frequency   |   Frequency  |   Percent    |    Percent   |
|--------------------------------------------------------------------------|
|     bing     |      194     |      194     |     19.4     |     19.4     |
|--------------------------------------------------------------------------|
|    direct    |      191     |      385     |     19.1     |     38.5     |
|--------------------------------------------------------------------------|
|    google    |      208     |      593     |     20.8     |     59.3     |
|--------------------------------------------------------------------------|
|    social    |      200     |      793     |      20      |     79.3     |
|--------------------------------------------------------------------------|
|     yahoo    |      207     |     1000     |     20.7     |      100     |
|--------------------------------------------------------------------------|


                              Variable: device                               
|--------------------------------------------------------------------------|
|                                Cumulative                    Cumulative  |
|    Levels    |  Frequency   |   Frequency  |   Percent    |    Percent   |
|--------------------------------------------------------------------------|
|    tablet    |      331     |      331     |     33.1     |     33.1     |
|--------------------------------------------------------------------------|
|    laptop    |      325     |      656     |     32.5     |     65.6     |
|--------------------------------------------------------------------------|
|    mobile    |      344     |     1000     |     34.4     |      100     |
|--------------------------------------------------------------------------|


                             Variable: bouncers                              
|--------------------------------------------------------------------------|
|                                Cumulative                    Cumulative  |
|    Levels    |  Frequency   |   Frequency  |   Percent    |    Percent   |
|--------------------------------------------------------------------------|
|     true     |      494     |      494     |     49.4     |     49.4     |
|--------------------------------------------------------------------------|
|     false    |      506     |     1000     |     50.6     |      100     |
|--------------------------------------------------------------------------|


                             Variable: purchase                              
|--------------------------------------------------------------------------|
|                                Cumulative                    Cumulative  |
|    Levels    |  Frequency   |   Frequency  |   Percent    |    Percent   |
|--------------------------------------------------------------------------|
|     true     |      103     |      103     |     10.3     |     10.3     |
|--------------------------------------------------------------------------|
|     false    |      897     |     1000     |     89.7     |      100     |
|--------------------------------------------------------------------------|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment