Skip to content

as_xxx functions should not drop names #50

Description

@TimTaylor
dat <- c(a = "2020-01-02")

# names kept
as.Date(dat)
#>            a 
#> "2020-01-02"

# names dropped
grates::as_yearweek(dat)
#> <grates_yearweek_monday[1]>
#> [1] "2020-W01"

# this should be TRUE
all.equal(
    as.Date(grates::as_yearweek(dat, 4)),
    as.Date(dat)
)
#> [1] "names for current but not for target"

Created on 2025-08-15 with reprex v2.1.1

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