dcomtois / summarytools

R Package to Quickly and Neatly Summarize Data
504 stars 77 forks source link

headings = FALSE has no effect by group with ctable #122

Closed iago-pssjd closed 4 years ago

iago-pssjd commented 4 years ago

Hi, When I try ctable with stby, headings = FALSE seems to not work:

> with(tobacco, 
+      stby(list(x = smoker, y = diseased, headings = FALSE), 
+           INDICES = gender, FUN = ctable))
Cross-Tabulation, Row Proportions  
smoker * diseased  
Data Frame: tobacco  
Group: gender = F  

-------- ---------- ------------- ------------- --------------
           diseased           Yes            No          Total
  smoker                                                      
     Yes               62 (42.2%)    85 (57.8%)   147 (100.0%)
      No               49 (14.3%)   293 (85.7%)   342 (100.0%)
   Total              111 (22.7%)   378 (77.3%)   489 (100.0%)
-------- ---------- ------------- ------------- --------------

Group: gender = M  

-------- ---------- ------------- ------------- --------------
           diseased           Yes            No          Total
  smoker                                                      
     Yes               63 (44.1%)    80 (55.9%)   143 (100.0%)
      No               47 (13.6%)   299 (86.4%)   346 (100.0%)
   Total              110 (22.5%)   379 (77.5%)   489 (100.0%)
-------- ---------- ------------- ------------- --------------

Thank you!

iago-pssjd commented 4 years ago

Now I saw that the problem was to include the argument headings in the list (as x and y), instead of in stby...

Sorry!