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

Inconsistency between tibble and vector formatting if "hours" component is zero #112

Open
markconnolly opened this issue Oct 26, 2022 · 1 comment

Comments

@markconnolly
Copy link

A tibble column renders in a console as (apparently) degree minutes and degree seconds rather than time hours:minutes:seconds if all occurrences have zero hours. Renders consistently and as expected in a notebook context, so impact is tiny. Merely disconcerting when trying things in the console.

library(tidyverse)

paces <- as_tibble_col(c("00:05:07", "00:05:25", "00:05:34",
                         "00:06:20", "00:06:21") %>% 
                         hms::as_hms(), column_name = "pace")
paces
#> # A tibble: 5 x 1
#>   pace  
#>   <time>
#> 1 05'07"
#> 2 05'25"
#> 3 05'34"
#> 4 06'20"
#> 5 06'21"
paces$pace
#> 00:05:07
#> 00:05:25
#> 00:05:34
#> 00:06:20
#> 00:06:21


paces2 <- as_tibble_col(c("01:05:07", "00:05:25", "00:05:34", 
                         "00:06:20", "00:06:21") %>% 
                         hms::as_hms(), column_name = "pace")
paces2
#> # A tibble: 5 x 1
#>   pace    
#>   <time>  
#> 1 01:05:07
#> 2 00:05:25
#> 3 00:05:34
#> 4 00:06:20
#> 5 00:06:21
paces2$pace
#> 01:05:07
#> 00:05:25
#> 00:05:34
#> 00:06:20
#> 00:06:21

Created on 2022-10-26 by the reprex package (v2.0.1)

@krlmlr krlmlr transferred this issue from tidyverse/tibble Oct 31, 2022
@krlmlr krlmlr changed the title Tibble renders time as degree minutes and seconds rather than HH:MM:SS Inconsistency between tibble and vector formatting Oct 31, 2022
@krlmlr krlmlr changed the title Inconsistency between tibble and vector formatting Inconsistency between tibble and vector formatting if "hours" component is zero Oct 31, 2022
@krlmlr
Copy link
Member

krlmlr commented Oct 31, 2022

Thanks. The minutes+seconds formatting is desired, but I do wonder why the formatting in a vector is different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants