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

Error with Duration from lubridate #88

Closed
krlmlr opened this issue Jan 14, 2018 · 3 comments
Closed

Error with Duration from lubridate #88

krlmlr opened this issue Jan 14, 2018 · 3 comments

Comments

@krlmlr
Copy link
Member

krlmlr commented Jan 14, 2018

x <- pillar::pillar(lubridate::as.duration(1))
#> Error: Incompatible duration classes (Duration, numeric). Please coerce with `as.duration`.

Created on 2018-01-14 by the reprex package (v0.1.1.9000).

This worked in 1.3.4, perhaps because the Duration class has a format() method which is called by format.data.frame(), but we only call pillar_shaft() which is dispatched to pillar_shaft.numeric().

@twedl
Copy link

twedl commented Feb 15, 2018

I get a similar error with periods

x <- pillar::pillar(lubridate::period(1))
#> Error in x < 0: cannot compare Period to Duration:
#> coerce with 'as.numeric' first.

Package versions:

pillar_1.1.0.9000 
reprex_0.1.2
lubridate_1.7.1

@krlmlr krlmlr closed this as completed in acb12b9 Feb 20, 2018
krlmlr added a commit that referenced this issue Feb 24, 2018
- The negation sign is printed next to the number again (#91).
- Scientific notation uses regular digits again for exponents (#90).
- Numeric values with a `"class"` attribute are now formatted using `format()` if the `pillar_shaft()` method is not implemented for that class (#88).
- Groups of three digits are now underlined, starting with the fourth before/after the decimal point (#78).
krlmlr added a commit that referenced this issue Feb 26, 2018
Display
-------

- Turned off using subtle style for digits that are considered insignificant.  Set the new option `pillar.subtle_num` to `TRUE` to turn it on again (default: `FALSE`).
- The negation sign is printed next to the number again (#91).
- Scientific notation uses regular digits again for exponents (#90).
- Groups of three digits are now underlined, starting with the fourth before/after the decimal point. This gives a better idea of the order of magnitude of the numbers (#78).
- Logical columns are displayed as `TRUE` and `FALSE` again (#95).
- The decimal dot is now always printed for numbers of type `numeric`. Trailing zeros are not displayed anymore if all displayed numbers are whole numbers (#62).
- Decimal values longer than 13 characters always print in scientific notation.

Bug fixes
---------

- Numeric values with a `"class"` attribute (e.g., `Duration` from lubridate) are now formatted using `format()` if the `pillar_shaft()` method is not implemented for that class (#88).
- Very small numbers (like `1e-310`) are now printed corectly (tidyverse/tibble#377).
- Fix representation of right-hand side for `getOption(pillar.sigfig) >= 6` (tidyverse/tibble#380).
- Fix computation of significant figures for numbers with absolute value >= 1 (#98).

New functions
-------------

- New styling helper `style_subtle_num()`, formatting depends on the `pillar.subtle_num` option.
@krlmlr
Copy link
Member Author

krlmlr commented Feb 26, 2018

Not yet :-(

@krlmlr krlmlr reopened this Feb 26, 2018
@krlmlr krlmlr closed this as completed in 8472829 Feb 26, 2018
krlmlr added a commit that referenced this issue Feb 27, 2018
Display
-------

- Turned off using subtle style for digits that are considered insignificant.  Negative numbers are shown all red.  Set the new option `pillar.subtle_num` to `TRUE` to turn it on again (default: `FALSE`).
- The negation sign is printed next to the number again (#91).
- Scientific notation uses regular digits again for exponents (#90).
- Groups of three digits are now underlined, starting with the fourth before/after the decimal point. This gives a better idea of the order of magnitude of the numbers (#78).
- Logical columns are displayed as `TRUE` and `FALSE` again (#95).
- The decimal dot is now always printed for numbers of type `numeric`. Trailing zeros are not shown anymore if all displayed numbers are whole numbers (#62).
- Decimal values longer than 13 characters always print in scientific notation.

Bug fixes
---------

- Numeric values with a `"class"` attribute (e.g., `Duration` from lubridate) are now formatted using `format()` if the `pillar_shaft()` method is not implemented for that class (#88).
- Very small numbers (like `1e-310`) are now printed corectly (tidyverse/tibble#377).
- Fix representation of right-hand side for `getOption("pillar.sigfig") >= 6` (tidyverse/tibble#380).
- Fix computation of significant figures for numbers with absolute value >= 1 (#98).

New functions
-------------

- New styling helper `style_subtle_num()`, formatting depends on the `pillar.subtle_num` option.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2020

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 Dec 9, 2020
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