-
Notifications
You must be signed in to change notification settings - Fork 37
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
(single) record view #317
Comments
Thanks. Does |
Sorry, should've mentioned d <- data.frame(x = c(1, 100), y = c(100, 1))
dplyr::glimpse(d)
#> Rows: 2
#> Columns: 2
#> $ x <dbl> 1, 100
#> $ y <dbl> 100, 1 Created on 2021-05-21 by the reprex package (v2.0.0) (I realize that this is probably a pretty niche issue, so feel free to close if you think this is out of scope.) |
Thanks. Should we add an I don't understand "the same useful formatting that Other than that, I think most if not all of the tools to build custom views of the data are exported by pillar, please let me know if anything's missing. |
Yes, Regarding the second point, library("tibble")
df <- tibble(
s = haven::labelled(c("M", "M", "F"), c(Male = "M", Female = "F")),
x = rnorm(3)
)
df
#> # A tibble: 3 x 2
#> s x
#> <chr+lbl> <dbl>
#> 1 M [Male] 0.0849
#> 2 M [Male] 0.842
#> 3 F [Female] -0.481
glimpse(df)
#> Rows: 3
#> Columns: 2
#> $ s <chr+lbl> "M", "M", "F"
#> $ x <dbl> 0.08492588, 0.84195136, -0.48107764 Created on 2021-05-25 by the reprex package (v2.0.0) |
This may have come up before, but I couldn't find anything in the
tibble
package or here.It might be desirable to implement a printing mode that "transposes" the tibble. This came up when demonstrating
bloom::glance
on a presentation slide, where the output looks like this:(the white space got messed up a bit when copying from the PDF)
In this case, all columns are numeric, so the matrix transpose doesn't look so bad:
However, tibble could of course support this more fully, including a column for the column type and applying the correct formatting. A similar feature exists in PostgreSQL: https://stackoverflow.com/questions/9604723/alternate-output-format-for-psql. I always found this nice to have.
One could even go so far as treating a single row like a "record", and defaulting to printing it this way. But that might be confusing.
The text was updated successfully, but these errors were encountered: