tests/testthat/_snaps/cross-table.md

output from ds_cross_table is as expected

Code
  ds_cross_table(mtcarz, cyl, gear)
Output
      Cell Contents
   |---------------|
   |     Frequency |
   |       Percent |
   |       Row Pct |
   |       Col Pct |
   |---------------|

   Total Observations:  32

  ----------------------------------------------------------------------------
  |              |                           gear                            |
  ----------------------------------------------------------------------------
  |          cyl |            3 |            4 |            5 |    Row Total |
  ----------------------------------------------------------------------------
  |            4 |            1 |            8 |            2 |           11 |
  |              |        0.031 |         0.25 |        0.062 |              |
  |              |         0.09 |         0.73 |         0.18 |         0.34 |
  |              |         0.07 |         0.67 |          0.4 |              |
  ----------------------------------------------------------------------------
  |            6 |            2 |            4 |            1 |            7 |
  |              |        0.062 |        0.125 |        0.031 |              |
  |              |         0.29 |         0.57 |         0.14 |         0.22 |
  |              |         0.13 |         0.33 |          0.2 |              |
  ----------------------------------------------------------------------------
  |            8 |           12 |            0 |            2 |           14 |
  |              |        0.375 |            0 |        0.062 |              |
  |              |         0.86 |            0 |         0.14 |         0.44 |
  |              |          0.8 |            0 |          0.4 |              |
  ----------------------------------------------------------------------------
  | Column Total |           15 |           12 |            5 |           32 |
  |              |        0.468 |        0.375 |        0.155 |              |
  ----------------------------------------------------------------------------


Try the descriptr package in your browser

Any scripts or data that you put into this service are public.

descriptr documentation built on April 3, 2025, 8:46 p.m.