calendR icon indicating copy to clipboard operation
calendR copied to clipboard

Epidemiological weeks

Open zjfspz opened this issue 4 years ago • 12 comments

Would it be possible to be make it possible to add a epidemiological week number of the year for each week? (suggestion: i use lubridate::epiweek in my codes)

I'm looking for something similar to this epidemiological calendar: https://vigilancia.ispch.gob.cl/app_direct/varcovid/#shiny-tab-cal_epi

zjfspz avatar Jan 07 '22 23:01 zjfspz

As of now, calendR hardcodes %W for the week numbers. Sure it would be possible to change that. In case @R-CoderDotCom is not interested in adding this feature (e.g. to not pull in lubridate as additional dependency): I am working on a fork of calendR ~(still awaiting some clarification of the licensing before publishing it)~ and would be willing to add this in. Expect a couple of weeks to pass though before I can get to it myself.

mschilli87 avatar Jan 08 '22 09:01 mschilli87

FWIW I just realized calendR already depends on lubridate (via suncalc), so I see no reason not to add this.

mschilli87 avatar Jan 09 '22 12:01 mschilli87

Great! When do you think it is possible to make that update?

zjfspz avatar Jan 10 '22 13:01 zjfspz

@zjfspz: It's really hard to make an estimate since I have very little spare time right now. I would say January is very unlikely, but maybe February. I am sorry I won't get it to it sooner. It's not a big change but there are many things want to get done before this. :wink:

mschilli87 avatar Jan 10 '22 15:01 mschilli87

Hello again!

I was passing by to ask if you had time to look at this thread. In any case, thank you very much for considering my request.

Greetings!

zjfspz avatar Feb 14 '22 13:02 zjfspz

@zjfspz: Sorry, work at my day job got even more tense than anticipated. I really hope to get to working on my fork in the next couple of weeks. This is definitely high on my to-do list. But thanks for reminding me. It's good to know that there is still interest. Apologies for the delay.

mschilli87 avatar Feb 14 '22 14:02 mschilli87

@zjfspz: Would a new parameter week.number.style with default options "default", "iso", and "epi" work for your use case? I don't want to add this directly to week.number to keep backwards compatibility with the TRUE/FALSE flag used right now. If you have a better suggestion, please let me know soon as I'm about to start working on this.

mschilli87 avatar Mar 10 '22 21:03 mschilli87

I think it would work perfect. Great, I'm waiting for your results. Greetings,

zjfspz avatar Mar 10 '22 21:03 zjfspz

@zjfspz: I did find some time to work on my fork and hope to get to this over the coming weekend. So if all goes well, this could land on CRAN before the end of the month.

mschilli87 avatar Mar 23 '22 16:03 mschilli87

Excellent! I will be attentive to your confirmation to test the new function Thank you

zjfspz avatar Mar 25 '22 15:03 zjfspz

@R-CoderDotCom Did you make progress with this?

zjfspz avatar Jun 08 '22 14:06 zjfspz

@zjfspz: I made a lot of progress on my fork in March but since then I did not have time to work after my dayjob. I still plan on getting back to this, hopefully in summer, and will post here once I finally get it done. Apologies for the slow progress but sometimes life gets in the way.

mschilli87 avatar Jun 08 '22 14:06 mschilli87