Skip to content

Commit

Permalink
show also total number of rows
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Müller committed Mar 19, 2016
1 parent d4b7bd7 commit a2dd6b9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions R/utils-format.r
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ print.trunc_mat <- function(x, ...) {
if (is.na(x$rows_missing)) {
cat(".. (more rows)")
} else if (x$rows_missing > 0) {
cat(wrap(".. (", big_mark(x$rows_missing), " more rows)",
width = x$width), "\n", sep ="")
cat(wrap(".. (",
big_mark(x$rows_missing), " more rows, ",
big_mark(x$rows_total), " total)", width = x$width),
"\n", sep ="")
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/output/trunc_mat/all-1-30-2.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
a b c d
<dbl> <int> <lgl> <chr>
1 1 1 TRUE a
.. (1 more rows)
.. (1 more rows, 2 total)
Variables not shown: e
<fctr>, f <date>, and 2
more <...>.
2 changes: 1 addition & 1 deletion tests/testthat/output/trunc_mat/iris--70.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
8 5.0 3.4 1.5 0.2 setosa
9 4.4 2.9 1.4 0.2 setosa
10 4.9 3.1 1.5 0.1 setosa
.. (140 more rows)
.. (140 more rows, 150 total)
4 changes: 3 additions & 1 deletion tests/testthat/output/trunc_mat/iris-3-5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
..
(147
more
rows)
rows,
150
total)
Variables
not
shown:
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/output/trunc_mat/iris-5-30.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
3 4.7 3.2
4 4.6 3.1
5 5.0 3.6
.. (145 more rows)
.. (145 more rows, 150 total)
Variables not shown:
Petal.Length <dbl>,
Petal.Width <dbl>, Species
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/output/trunc_mat/mtcars-8-30.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
6 18.1 6 225.0 105
7 14.3 8 360.0 245
8 24.4 4 146.7 62
.. (24 more rows)
.. (24 more rows, 32 total)
Variables not shown: drat
<dbl>, wt <dbl>, qsec
<dbl>, vs <dbl>, am <dbl>,
Expand Down

0 comments on commit a2dd6b9

Please sign in to comment.