JuliaStats/DataFrames.jl — pull request #459 by johnmyleswhite (2013-12-28 23:08:09+00:00)
Title: showall produces readable tables with many columns

This PR, which should be accompanied by some clean up of our printing code, changes `showall(df)` to produce a series of Multimarkdown tables as output, each of which fits within the current TTY window. `showall(df, false)` produces a single Multimarkdown table that will not necessarily fit in the TTY window.

Some sample output:

julia> using DataFrames

julia> df = DataFrame(A = 1:3,
B = ["Group A", "Group Alabama", "Group A"],
C = ["Bigger Group A", "Bigger Group Alabama", "Bigger Group A"],
D = ["Bigger Group A", "Bigger Group Alabama", "Bigger Group A"],
E = ["Bigger Group A", "Bigger Group Alabama", "Bigger Group A"],
F = ["Bigger Group A", "Bigger Group Alabama", "Bigger Group A"])
DataFrame with 3 rows, 6 columns
Columns:

A 3 non-null values
B 3 non-null values
C 3 non-null values
D 3 non-null values
E 3 non-null values
F 3 non-null values

julia> showall(df)
3x6 DataFrame:
|-------|---|---------------|----------------------|----------------------|
| Row # | A | B | C | D |
| 1 | 1 | Group A | Bigger Group A | Bigger Group A |
| 2 | 2 | Group Alabama | Bigger Group Alabama | Bigger Group Alabama |
| 3 | 3 | Group A | Bigger Group A | Bigger Group A |
|-------|----------------------|----------------------|
| Row # | E | F |
| 1 | Bigger Group A | Bigger Group A |
| 2 | Bigger Group Alabama | Bigger Group Alabama |
| 3 | Bigger Group A | Bigger Group A |

julia> showall(df, false)
3x6 DataFrame:
|-------|---|---------------|----------------------|----------------------|----------------------|----------------------|
| Row # | A | B | C | D | E | F |
| 1 | 1 | Group A | Bigger Group A | Bigger Group A | Bigger Group A | Bigger Group A |
| 2 | 2 | Group Alabama | Bigger Group Alabama | Bigger Group Alabama | Bigger Group Alabama | Bigger Group Alabama |
| 3 | 3 | Group A | Bigger Group A | Bigger Group A | Bigger Group A | Bigger Group A |