-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print.tbl_df() fixup #51
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
44d9cf9
omit dots if length known
92a7191
show number of missing rows in last line
ead7eca
omit source information and dimensions for data frame sources
ade1107
update README
3dea6e5
test output if number of rows unknown
68f726b
add test output
c928632
always print number of rows if zero-row or zero-col data frame
3f4f968
rename, test corner case
23e1860
new-style output
3c60db9
split print(), also return output invisibly
606e1f0
support n_extra = 0
40c032c
remove unused dim_desc()
179e3b1
update README
e5e62ca
more variables after colon, not in parentheses
390196f
format_extra_...() instead of print_extra_...()
e10ba05
extract format_extra()
880533d
knit_print() uses same extra formatting logic as trunc_mat()
22fa833
formatting
3dd4c87
separate concerns, simplify
f469b20
extra on one line, if possible
c858418
special case: zero rows
51f5693
update README
46bd4c8
use non-breaking space to keep name and type together
1477a2d
Merge branch 'master' into feature/19-remove-ellipsis
e965547
Merge remote-tracking branch 'origin/master' into feature/19-remove-e…
262424a
move code
b35106c
new unknown_rows helper class
127cb99
add desired output
1e9afc1
use question marks instead of NA for unknown dims
c66545a
don't print rows for empty data frames
396863f
use obj_sum() to print one-line summary
eaaa0e8
update README
c1e71be
explicitly register S3 methods used only in tests
fee06df
tibble instead of tbl_df in output
e019d2f
show big marks in size_sum()
a8454a9
update README
f4321f4
include summary in knitr output
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
as_unknown_rows <- function(x) { | ||
x <- as_data_frame(x) | ||
class(x) <- c("unknown_rows", class(x)) | ||
x | ||
} | ||
|
||
dim.unknown_rows <- function(x) { | ||
c(NA_integer_, length(x)) | ||
} | ||
|
||
registerS3method("dim", "unknown_rows", dim.unknown_rows) | ||
|
||
head.unknown_rows <- function(x, n) { | ||
head(as.data.frame(x), n) | ||
} | ||
|
||
registerS3method("head", "unknown_rows", head.unknown_rows) | ||
|
||
type_sum.unknown_rows <- function(x) "unknown_rows" | ||
|
||
registerS3method("type_sum", "unknown_rows", type_sum.unknown_rows) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
Source: local data frame [3 x 8] | ||
|
||
<tibble [3 x 8]> | ||
a b c d | ||
<dbl> <int> <lgl> <chr> | ||
1 1.0 1 TRUE a | ||
2 2.5 2 FALSE b | ||
3 NA NA NA <NA> | ||
Variables not shown: e | ||
<fctr>, f <date>, g <time>, | ||
h <list>. | ||
... with 4 more variables: | ||
e <fctr>, f <date>, | ||
g <time>, h <list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<tibble [3 x 8]> | ||
a b c d | ||
<dbl> <int> <lgl> <chr> | ||
1 1 1 TRUE a | ||
... with 2 more rows, and 4 | ||
more variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
.. ... ... ... ... | ||
Variables not shown: e | ||
<fctr>, f <date>, and 2 | ||
more <...>. | ||
<tibble [3 x 8]> | ||
a b c d | ||
<dbl> <int> <lgl> <chr> | ||
1 1 1 TRUE a | ||
... with 2 more rows, and 4 | ||
more variables: e <fctr>, | ||
f <date>, ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
|
||
|
||
tibble [3 x 8] | ||
|
||
|a |b |c |d |e |f | | ||
|:-----|:-----|:-----|:-----|:------|:----------| | ||
|<dbl> |<int> |<lgl> |<chr> |<fctr> |<date> | | ||
|1.0 |1 |TRUE |a |a |2015-12-10 | | ||
|2.5 |2 |FALSE |b |b |2015-12-11 | | ||
|NA |NA |NA |<NA> |NA |NA | | ||
|
||
(_Variables not shown_: g <time>, h <list>) | ||
(with 2 more variables: g <time>, h <list>) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to update README before, this is the only change: Now extra rows and extra columns are shown in the same line. Not sure what's better.