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

tribble() does not handle correctly objects of class Period (lubridate) #784

Closed
mbeer opened this issue Jun 5, 2020 · 3 comments
Closed

Comments

@mbeer
Copy link

mbeer commented Jun 5, 2020

Using tribble() to create a tibble with an object of class Period (lubridate) fails. The object is saved as numeric 0. When the same is done with tibble(), everything is fine. See the reprex below.

This might be linked to issue #770 I had reported earlier.

library(tibble)
tribble(~period, lubridate::days(1))
#> # A tibble: 1 x 1
#>   period
#>    <dbl>
#> 1      0
tibble(period = lubridate::days(1))
#> # A tibble: 1 x 1
#>   period     
#>   <Period>   
#> 1 1d 0H 0M 0S

Created on 2020-06-05 by the reprex package (v0.3.0)

@krlmlr
Copy link
Member

krlmlr commented Jun 14, 2020

Thanks for reporting!

@mbeer
Copy link
Author

mbeer commented Jun 15, 2020

Thanks for reporting!

Thanks for fixing!

krlmlr added a commit that referenced this issue Feb 25, 2021
tibble 3.0.2

- `[[` works with classed indexes again, e.g. created with `glue::glue()` (#778).
- `add_column()` works without warning for 0-column data frames (#786).
- `tribble()` now better handles named inputs (#775) and objects of non-vtrs classes like `lubridate::Period` (#784) and `formattable::formattable` (#785).

- Subsetting and subassignment are faster (#780, #790, #794).
- `is.null()` is preferred over `is_null()` for speed.
- Implement continuous benchmarking (#793).

- `is_vector_s3()` is no longer reexported from pillar (#789).
@github-actions
Copy link
Contributor

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants