-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propose not to override standard
argument while defining a non-NULL first_date
#87
Comments
Hi Jun, Can you please post a reproducible example? I can't really diagnose anything until this is done. Also, what happens if you specify
My thought process when making the decision is that if the user specifies a On the other hand, if we were to make the default that Unfortunately, changing behavior like this is backwards-incompatible. What if we printed a message telling the user the first date they should use to achieve the equivalent to standard specification?
|
As a side note: I will not be able to add anything new to incidence in the next month. I will be away for a family emergency in Korea. |
The code and data for reproducing my issue is shown below.
For this usage, I think it is exactly the
Specifying
For this unexpected situation, we can print a message to tell the user that the returning timespan is not the same as the user's input, and suggest the user to set |
The user is likely to be confused in either situation. The problem with switching the behavior here is that it will break backwards compatibility.
I agree that it's not ideal to force the user to figure out what date would be the start of any given week; but for months, quarters, and years, the user should know what the start is, so it's really the week specification that is the weak point here, which is why I'm hesitant to change the default behavior. What I would offer is to add two things:
We could also allow for the specification of the first isoweek for the first date (e.g. Again, I'm not going to be able to work on this for another month. |
Last night I couldn't sleep and thought this issue again. I can't help discussing it a bit more. Here the design is against principles of software engineering that I learned.
It is not urgent to fix this issue. Currently I am writing my PhD thesis, and I have no time to resolve it. After I submit my thesis, I would fix it if it is still unresolved. |
Hi Jun, I'm sorry to hear that you couldn't sleep. I hope you get some rest soon. Thinking this over again, the arguments you lay out make sense. Moreover, the change would be conceptually consistent with the default behavior of standardizing from the first observed date if The control structure that defines the behavior is here: Line 37 in 0d6b793
Here are the foreseeable tasks:
|
These days I am updating my analysis code for 2009 influenza A(H1N1) pandemic by using incidence package. When calculating ISO week based epidemic curve, I specified the starting date and ending date to extend the timespan. My command is as follows
I am confused by the returned incidence data.frame. Taking the second row for example, according to the
dates
column, 2 cases were observed during a week (7 days) from 2009-05-08 to 2009-05-14. However, according to theisoweeks
column, 2 cases were counted during the ISO week 2009-W19, which was from 2009-05-04 to 2009-05-10. I looked at my data, only 1 case occurred from 2009-05-04 to 2009-05-10.Without specifying the starting date and ending date, the returned incidence data.frame is what I expected.
I read the help file of the
standard
argument and found this is because this argument is overridden by defining a non-NULLfirst_date
. Therefore, I suggest that whenfirst_date
and/orlast_date
are non-NULL, thestandard
argument is not overridden, and thedates
column still stores the beginning of standard weeks. In this case,first_date
andlast_date
are only used for extending or reducing the timespan. Of course, the range of standard weeks usually is not the same as the range specified byfirst_date
and/orlast_date
, but we can echo a message to remind the users.The text was updated successfully, but these errors were encountered: