Skip to content

Unexpected automatic frequency detection with yearly data #170

@marcozanotti

Description

@marcozanotti

Hi @mdancho84 ,

I am encountering something unexpected in timetk::tk_get_frequency() when applied to yearly data.
For instance, you can check with the following code.

data <- tibble::tibble(
  "date" = seq.Date(as.Date("1960-01-01"), as.Date("2017-01-01"), by = "year"),
  "id" = "EU Population",
  "value" = tsibbledata::global_economy |> dplyr::filter(Country == "European Union") |> dplyr::pull(Population)
)
timetk::tk_get_frequency(data[["date"]])

timetk::tk_get_frequency() returns 5 in this example, while I would expect the frequency to be 1 for yearly data.

Thanks for your help.

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