Without ascii package
> library(remix) > remix(data = esoph) cbind(ncases,ncontrols) ~ . =========================== +-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | mean | sd | quantile 0% | quantile 25% | quantile 50% | quantile 75% | quantile 100% | n | na | +===========+=======+=======+=============+==============+==============+==============+===============+====+=====+ | ncases | 2.27 | 2.75 | 0 | 0 | 1 | 4 | 17 | 88 | 0 | +-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | ncontrols | 11.08 | 12.72 | 1 | 3 | 6 | 14 | 60 | 88 | 0 | +-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ cbind(agegp,alcgp,tobgp) ~ . ============================ +-------+-----------+----+------+ | | n | p | +=======+===========+====+======+ | agegp | 25-34 | 15 | 0.17 | + +-----------+----+------+ | | 35-44 | 15 | 0.17 | + +-----------+----+------+ | | 45-54 | 16 | 0.18 | + +-----------+----+------+ | | 55-64 | 16 | 0.18 | + +-----------+----+------+ | | 65-74 | 15 | 0.17 | + +-----------+----+------+ | | 75+ | 11 | 0.12 | +-------+-----------+----+------+ | alcgp | 0-39g/day | 23 | 0.26 | + +-----------+----+------+ | | 40-79 | 23 | 0.26 | + +-----------+----+------+ | | 80-119 | 21 | 0.24 | + +-----------+----+------+ | | 120+ | 21 | 0.24 | +-------+-----------+----+------+ | tobgp | 0-9g/day | 24 | 0.27 | + +-----------+----+------+ | | 10-19 | 24 | 0.27 | + +-----------+----+------+ | | 20-29 | 20 | 0.23 | + +-----------+----+------+ | | 30+ | 20 | 0.23 | +-------+-----------+----+------+ > remix(cbind(...) ~ tobgp, esoph) cbind(ncases,ncontrols) ~ tobgp =============================== +-------+----------+-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | mean | sd | quantile 0% | quantile 25% | quantile 50% | quantile 75% | quantile 100% | n | na | +=======+==========+===========+=======+=======+=============+==============+==============+==============+===============+====+=====+ | tobgp | 0-9g/day | ncases | 3.25 | 4.02 | 0 | 0 | 2 | 5 | 17 | 24 | 0 | + + +-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | ncontrols | 21.88 | 18.72 | 1 | 4 | 17 | 38.50 | 60 | 24 | 0 | + +----------+-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | 10-19 | ncases | 2.42 | 2.34 | 0 | 0.75 | 1.50 | 4 | 8 | 24 | 0 | + + +-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | ncontrols | 9.83 | 7.42 | 1 | 3 | 8.50 | 14.25 | 23 | 24 | 0 | + +----------+-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | 20-29 | ncases | 1.65 | 1.66 | 0 | 0 | 1.50 | 2.25 | 5 | 20 | 0 | + + +-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | ncontrols | 6.60 | 4.77 | 1 | 3 | 5.50 | 9.25 | 17 | 20 | 0 | + +----------+-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | 30+ | ncases | 1.55 | 1.88 | 0 | 0 | 1 | 3.25 | 5 | 20 | 0 | + + +-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | ncontrols | 4.10 | 2.43 | 1 | 2 | 4 | 6 | 8 | 20 | 0 | +-------+----------+-----------+-------+-------+-------------+--------------+--------------+--------------+---------------+----+-----+ cbind(agegp,alcgp) ~ tobgp ========================== +-------+-----------+------+----------+-------+-------+------+ | | tobgp | + +----------+-------+-------+------+ | | 0-9g/day | 10-19 | 20-29 | 30+ | +=======+===========+======+==========+=======+=======+======+ | agegp | 25-34 | n | 4 | 4 | 3 | 4 | + + +------+----------+-------+-------+------+ | | | cell | 0.05 | 0.05 | 0.03 | 0.05 | + + +------+----------+-------+-------+------+ | | | row | 0.27 | 0.27 | 0.20 | 0.27 | + + +------+----------+-------+-------+------+ | | | col | 0.17 | 0.17 | 0.15 | 0.20 | + +-----------+------+----------+-------+-------+------+ | | 35-44 | n | 4 | 4 | 4 | 3 | + + +------+----------+-------+-------+------+ | | | cell | 0.05 | 0.05 | 0.05 | 0.03 | + + +------+----------+-------+-------+------+ | | | row | 0.27 | 0.27 | 0.27 | 0.20 | + + +------+----------+-------+-------+------+ | | | col | 0.17 | 0.17 | 0.20 | 0.15 | + +-----------+------+----------+-------+-------+------+ | | 45-54 | n | 4 | 4 | 4 | 4 | + + +------+----------+-------+-------+------+ | | | cell | 0.05 | 0.05 | 0.05 | 0.05 | + + +------+----------+-------+-------+------+ | | | row | 0.25 | 0.25 | 0.25 | 0.25 | + + +------+----------+-------+-------+------+ | | | col | 0.17 | 0.17 | 0.20 | 0.20 | + +-----------+------+----------+-------+-------+------+ | | 55-64 | n | 4 | 4 | 4 | 4 | + + +------+----------+-------+-------+------+ | | | cell | 0.05 | 0.05 | 0.05 | 0.05 | + + +------+----------+-------+-------+------+ | | | row | 0.25 | 0.25 | 0.25 | 0.25 | + + +------+----------+-------+-------+------+ | | | col | 0.17 | 0.17 | 0.20 | 0.20 | + +-----------+------+----------+-------+-------+------+ | | 65-74 | n | 4 | 4 | 4 | 3 | + + +------+----------+-------+-------+------+ | | | cell | 0.05 | 0.05 | 0.05 | 0.03 | + + +------+----------+-------+-------+------+ | | | row | 0.27 | 0.27 | 0.27 | 0.20 | + + +------+----------+-------+-------+------+ | | | col | 0.17 | 0.17 | 0.20 | 0.15 | + +-----------+------+----------+-------+-------+------+ | | 75+ | n | 4 | 4 | 1 | 2 | + + +------+----------+-------+-------+------+ | | | cell | 0.05 | 0.05 | 0.01 | 0.02 | + + +------+----------+-------+-------+------+ | | | row | 0.36 | 0.36 | 0.09 | 0.18 | + + +------+----------+-------+-------+------+ | | | col | 0.17 | 0.17 | 0.05 | 0.10 | +-------+-----------+------+----------+-------+-------+------+ | alcgp | 0-39g/day | n | 6 | 6 | 5 | 6 | + + +------+----------+-------+-------+------+ | | | cell | 0.07 | 0.07 | 0.06 | 0.07 | + + +------+----------+-------+-------+------+ | | | row | 0.26 | 0.26 | 0.22 | 0.26 | + + +------+----------+-------+-------+------+ | | | col | 0.25 | 0.25 | 0.25 | 0.30 | + +-----------+------+----------+-------+-------+------+ | | 40-79 | n | 6 | 6 | 6 | 5 | + + +------+----------+-------+-------+------+ | | | cell | 0.07 | 0.07 | 0.07 | 0.06 | + + +------+----------+-------+-------+------+ | | | row | 0.26 | 0.26 | 0.26 | 0.22 | + + +------+----------+-------+-------+------+ | | | col | 0.25 | 0.25 | 0.30 | 0.25 | + +-----------+------+----------+-------+-------+------+ | | 80-119 | n | 6 | 6 | 4 | 5 | + + +------+----------+-------+-------+------+ | | | cell | 0.07 | 0.07 | 0.05 | 0.06 | + + +------+----------+-------+-------+------+ | | | row | 0.29 | 0.29 | 0.19 | 0.24 | + + +------+----------+-------+-------+------+ | | | col | 0.25 | 0.25 | 0.20 | 0.25 | + +-----------+------+----------+-------+-------+------+ | | 120+ | n | 6 | 6 | 5 | 4 | + + +------+----------+-------+-------+------+ | | | cell | 0.07 | 0.07 | 0.06 | 0.05 | + + +------+----------+-------+-------+------+ | | | row | 0.29 | 0.29 | 0.24 | 0.19 | + + +------+----------+-------+-------+------+ | | | col | 0.25 | 0.25 | 0.25 | 0.20 | +-------+-----------+------+----------+-------+-------+------+ > remix(cbind(...) ~ Species, iris) cbind(Sepal.Length,Sepal.Width,Petal.Length,Petal.Width) ~ Species ================================================================== +---------+------------+--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | mean | sd | quantile 0% | quantile 25% | quantile 50% | quantile 75% | quantile 100% | n | na | +=========+============+==============+=======+======+=============+==============+==============+==============+===============+====+=====+ | Species | setosa | Sepal.Length | 5.01 | 0.35 | 4.30 | 4.80 | 5 | 5.20 | 5.80 | 50 | 0 | + + +--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | Sepal.Width | 3.43 | 0.38 | 2.30 | 3.20 | 3.40 | 3.67 | 4.40 | 50 | 0 | + + +--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | Petal.Length | 1.46 | 0.17 | 1 | 1.40 | 1.50 | 1.57 | 1.90 | 50 | 0 | + + +--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | Petal.Width | 0.25 | 0.11 | 0.10 | 0.20 | 0.20 | 0.30 | 0.60 | 50 | 0 | + +------------+--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | versicolor | Sepal.Length | 5.94 | 0.52 | 4.90 | 5.60 | 5.90 | 6.30 | 7 | 50 | 0 | + + +--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | Sepal.Width | 2.77 | 0.31 | 2 | 2.52 | 2.80 | 3 | 3.40 | 50 | 0 | + + +--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | Petal.Length | 4.26 | 0.47 | 3 | 4 | 4.35 | 4.60 | 5.10 | 50 | 0 | + + +--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | Petal.Width | 1.33 | 0.20 | 1 | 1.20 | 1.30 | 1.50 | 1.80 | 50 | 0 | + +------------+--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | virginica | Sepal.Length | 6.59 | 0.64 | 4.90 | 6.22 | 6.50 | 6.90 | 7.90 | 50 | 0 | + + +--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | Sepal.Width | 2.97 | 0.32 | 2.20 | 2.80 | 3 | 3.17 | 3.80 | 50 | 0 | + + +--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | Petal.Length | 5.55 | 0.55 | 4.50 | 5.10 | 5.55 | 5.88 | 6.90 | 50 | 0 | + + +--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+ | | | Petal.Width | 2.03 | 0.27 | 1.40 | 1.80 | 2 | 2.30 | 2.50 | 50 | 0 | +---------+------------+--------------+-------+------+-------------+--------------+--------------+--------------+---------------+----+-----+
With ascii package
> library(remix) > ascii(remix(data = esoph))
cbind(ncases,ncontrols) ~ .
mean |
sd |
quantile 0% |
quantile 25% |
quantile 50% |
quantile 75% |
quantile 100% |
n |
na |
|
ncases |
2.27 |
2.75 |
0 |
0 |
1 |
4 |
17 |
88 |
0 |
ncontrols |
11.08 |
12.72 |
1 |
3 |
6 |
14 |
60 |
88 |
0 |
cbind(agegp,alcgp,tobgp) ~ .
n |
p |
||
agegp |
25-34 |
15 |
0.17 |
35-44 |
15 |
0.17 |
|
45-54 |
16 |
0.18 |
|
55-64 |
16 |
0.18 |
|
65-74 |
15 |
0.17 |
|
75+ |
11 |
0.12 |
|
alcgp |
0-39g/day |
23 |
0.26 |
40-79 |
23 |
0.26 |
|
80-119 |
21 |
0.24 |
|
120+ |
21 |
0.24 |
|
tobgp |
0-9g/day |
24 |
0.27 |
10-19 |
24 |
0.27 |
|
20-29 |
20 |
0.23 |
|
30+ |
20 |
0.23 |
|
> ascii(remix(cbind(...) ~ tobgp, esoph))
cbind(ncases,ncontrols) ~ tobgp
mean |
sd |
quantile 0% |
quantile 25% |
quantile 50% |
quantile 75% |
quantile 100% |
n |
na |
|||
tobgp |
0-9g/day |
ncases |
3.25 |
4.02 |
0 |
0 |
2 |
5 |
17 |
24 |
0 |
ncontrols |
21.88 |
18.72 |
1 |
4 |
17 |
38.50 |
60 |
24 |
0 |
||
10-19 |
ncases |
2.42 |
2.34 |
0 |
0.75 |
1.50 |
4 |
8 |
24 |
0 |
|
ncontrols |
9.83 |
7.42 |
1 |
3 |
8.50 |
14.25 |
23 |
24 |
0 |
||
20-29 |
ncases |
1.65 |
1.66 |
0 |
0 |
1.50 |
2.25 |
5 |
20 |
0 |
|
ncontrols |
6.60 |
4.77 |
1 |
3 |
5.50 |
9.25 |
17 |
20 |
0 |
||
30+ |
ncases |
1.55 |
1.88 |
0 |
0 |
1 |
3.25 |
5 |
20 |
0 |
|
ncontrols |
4.10 |
2.43 |
1 |
2 |
4 |
6 |
8 |
20 |
0 |
||
cbind(agegp,alcgp) ~ tobgp
tobgp |
||||||
0-9g/day |
10-19 |
20-29 |
30+ |
|||
agegp |
25-34 |
n |
4 |
4 |
3 |
4 |
cell |
0.05 |
0.05 |
0.03 |
0.05 |
||
row |
0.27 |
0.27 |
0.20 |
0.27 |
||
col |
0.17 |
0.17 |
0.15 |
0.20 |
||
35-44 |
n |
4 |
4 |
4 |
3 |
|
cell |
0.05 |
0.05 |
0.05 |
0.03 |
||
row |
0.27 |
0.27 |
0.27 |
0.20 |
||
col |
0.17 |
0.17 |
0.20 |
0.15 |
||
45-54 |
n |
4 |
4 |
4 |
4 |
|
cell |
0.05 |
0.05 |
0.05 |
0.05 |
||
row |
0.25 |
0.25 |
0.25 |
0.25 |
||
col |
0.17 |
0.17 |
0.20 |
0.20 |
||
55-64 |
n |
4 |
4 |
4 |
4 |
|
cell |
0.05 |
0.05 |
0.05 |
0.05 |
||
row |
0.25 |
0.25 |
0.25 |
0.25 |
||
col |
0.17 |
0.17 |
0.20 |
0.20 |
||
65-74 |
n |
4 |
4 |
4 |
3 |
|
cell |
0.05 |
0.05 |
0.05 |
0.03 |
||
row |
0.27 |
0.27 |
0.27 |
0.20 |
||
col |
0.17 |
0.17 |
0.20 |
0.15 |
||
75+ |
n |
4 |
4 |
1 |
2 |
|
cell |
0.05 |
0.05 |
0.01 |
0.02 |
||
row |
0.36 |
0.36 |
0.09 |
0.18 |
||
col |
0.17 |
0.17 |
0.05 |
0.10 |
||
alcgp |
0-39g/day |
n |
6 |
6 |
5 |
6 |
cell |
0.07 |
0.07 |
0.06 |
0.07 |
||
row |
0.26 |
0.26 |
0.22 |
0.26 |
||
col |
0.25 |
0.25 |
0.25 |
0.30 |
||
40-79 |
n |
6 |
6 |
6 |
5 |
|
cell |
0.07 |
0.07 |
0.07 |
0.06 |
||
row |
0.26 |
0.26 |
0.26 |
0.22 |
||
col |
0.25 |
0.25 |
0.30 |
0.25 |
||
80-119 |
n |
6 |
6 |
4 |
5 |
|
cell |
0.07 |
0.07 |
0.05 |
0.06 |
||
row |
0.29 |
0.29 |
0.19 |
0.24 |
||
col |
0.25 |
0.25 |
0.20 |
0.25 |
||
120+ |
n |
6 |
6 |
5 |
4 |
|
cell |
0.07 |
0.07 |
0.06 |
0.05 |
||
row |
0.29 |
0.29 |
0.24 |
0.19 |
||
col |
0.25 |
0.25 |
0.25 |
0.20 |
||
> ascii(remix(cbind(...) ~ Species, iris))
cbind(Sepal.Length,Sepal.Width,Petal.Length,Petal.Width) ~ Species
mean |
sd |
quantile 0% |
quantile 25% |
quantile 50% |
quantile 75% |
quantile 100% |
n |
na |
|||
Species |
setosa |
Sepal.Length |
5.01 |
0.35 |
4.30 |
4.80 |
5 |
5.20 |
5.80 |
50 |
0 |
Sepal.Width |
3.43 |
0.38 |
2.30 |
3.20 |
3.40 |
3.67 |
4.40 |
50 |
0 |
||
Petal.Length |
1.46 |
0.17 |
1 |
1.40 |
1.50 |
1.57 |
1.90 |
50 |
0 |
||
Petal.Width |
0.25 |
0.11 |
0.10 |
0.20 |
0.20 |
0.30 |
0.60 |
50 |
0 |
||
versicolor |
Sepal.Length |
5.94 |
0.52 |
4.90 |
5.60 |
5.90 |
6.30 |
7 |
50 |
0 |
|
Sepal.Width |
2.77 |
0.31 |
2 |
2.52 |
2.80 |
3 |
3.40 |
50 |
0 |
||
Petal.Length |
4.26 |
0.47 |
3 |
4 |
4.35 |
4.60 |
5.10 |
50 |
0 |
||
Petal.Width |
1.33 |
0.20 |
1 |
1.20 |
1.30 |
1.50 |
1.80 |
50 |
0 |
||
virginica |
Sepal.Length |
6.59 |
0.64 |
4.90 |
6.22 |
6.50 |
6.90 |
7.90 |
50 |
0 |
|
Sepal.Width |
2.97 |
0.32 |
2.20 |
2.80 |
3 |
3.17 |
3.80 |
50 |
0 |
||
Petal.Length |
5.55 |
0.55 |
4.50 |
5.10 |
5.55 |
5.88 |
6.90 |
50 |
0 |
||
Petal.Width |
2.03 |
0.27 |
1.40 |
1.80 |
2 |
2.30 |
2.50 |
50 |
0 |
||