Thanks to visit codestin.com
Credit goes to github.com

Skip to content

support lubridate::duration objects for intervals #94

@mkoohafkan

Description

@mkoohafkan

pad() should support lubridate::duration objects as a possible input for the interval argument.

simple_df <- data.frame(day = as.Date(c('2016-04-01', '2016-04-03')),
                        some_value = c(3,4))

pad(simple_df, interval = "day")


library(lubridate)
pad(simple_df, interval = as.duration("day"))
#> Error in strsplit(interval_string, " ") : non-character argument

workaround= paste(as.numeric(as.duration("day")), "sec")
pad(simple_df, interval = workaround)

#>          day some_value
#> 1 2016-04-01          3
#> 2 2016-04-02         NA
#> 3 2016-04-03          4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions