Skip to content
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 should display columns for zero-row output #652

Closed
wch opened this issue Oct 2, 2014 · 2 comments
Closed

print.tbl_df should display columns for zero-row output #652

wch opened this issue Oct 2, 2014 · 2 comments
Assignees
Labels
feature a feature request or enhancement
Milestone

Comments

@wch
Copy link
Member

wch commented Oct 2, 2014

As things work now, no columns names are printed for zero-row output, and this can be confusing for users. It requires using str() just to find out what the columns are. See rstudio/ggvis#293 for an example of this confusion.

as.tbl(mtcars[0, ])
# Source: local data frame [0 x 11]
@hadley hadley added the feature a feature request or enhancement label Oct 30, 2014
@hadley hadley added this to the 0.3.1 milestone Oct 30, 2014
@hadley hadley self-assigned this Oct 30, 2014
@hadley
Copy link
Member

hadley commented Nov 18, 2014

What do you want it to print?

Source: local data frame [0 x 11]
  mpg cyl disp  hp drat   wt  qsec vs am gear carb

?

@wch
Copy link
Member Author

wch commented Nov 18, 2014

That output looks reasonable.

@hadley hadley closed this as completed in 7409ccc Nov 20, 2014
krlmlr pushed a commit to krlmlr/dplyr that referenced this issue Mar 2, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants