Skip to content

Error when computing time_length in years for a missing value #388

Closed
@larmarange

Description

@larmarange

Here an example:

> time_length(interval(NA,ymd("2016-01-01")))
[1] NA
> time_length(interval(NA,ymd("2016-01-01")), unit = "year")
Error in if (any(e2@year != 0)) { : missing value where TRUE/FALSE needed

The second command creates an error when NA is expected.

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