Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature request: new epiweek/epiyear functions would benefit from option to use "US-CDC" defn or "isoweek" #564

Closed
rbalshaw opened this issue Jul 10, 2017 · 6 comments

Comments

@rbalshaw
Copy link

<< continuing a discussion in #492 >>

The US/CDC uses an epiweek defined as starting on Sunday. Much of the rest of the world uses epiweeks that start on Monday (as in the definitions used by isoweek).

It would be helpful if the epiweek and epiyear functions had an option to permit the choice of either definition, perhaps following the week_start option as in wday?

As well, the documentation could indicate the rationale for this option, perhaps something as simple as

"The US/CDC uses an epiweek defined as starting on Sunday. Much of the rest of the world uses epiweeks starting on Monday -- as in the definitions used by isoweek.

Could these be added?

Thank you!

@vspinu
Copy link
Member

vspinu commented Oct 3, 2017

I have just looked into it, and I am afraid I either misunderstood this issue or you simply want isoweek and isoyear. isoweek is like eipiweek but starts on Monday, same for isoyear. So there is no issue.

@rbalshaw
Copy link
Author

rbalshaw commented Oct 3, 2017 via email

@vspinu
Copy link
Member

vspinu commented Oct 3, 2017

Ok. I am altering the documentation then:

#' @description `epiweek()` is the US CDC version of epidemiological week. It
#'   follows same rules as `isoweek()` but starts on Sunday. In other parts of
#'   the world the convention is to start epidemiological weeks on Monday,
#'   which is the same as `isoweek`.

If I ever write a new datetime package, everything will be ISO by default :)

@vspinu vspinu closed this as completed in e4ad2c3 Oct 3, 2017
@rbalshaw
Copy link
Author

rbalshaw commented Oct 3, 2017 via email

@stragu
Copy link
Contributor

stragu commented Jul 23, 2019

Hi @vspinu

I assume the documentation for epiyear() should also have the same information? Currently it only says:

epiyear() returns years according to the epidemilogical week calendars.

... with no mention of US vs ISO.

@rbalshaw
Copy link
Author

rbalshaw commented Jul 23, 2019 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants