Skip to content

Why can't you exactly divide a year-long interval by days? #445

@hadley

Description

@hadley
today <- today()
next_year <- today() + years(1)

(today %--% next_year) / days(1)
#> Remainder cannot be expressed as fraction of a period.
#>  Performing %/%.
#> estimate only: convert periods to intervals for accuracy
#> [1] 365

I think the warning "convert periods to intervals for accuracy" is also spurious. What period am I supposed to convert?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions