Join GitHub today
QDay Reporting in Number of Seconds #543
This seems to be more of a difference between how each of the functions works so might be considered more of a feature request. Unlike day, wday and yday who all report themselves in an integer form in the number of days since their respective dates - qday reports itself in the number of seconds since the period turn. It seems as though this behavior should be able to be matched to the other functions. Since qday does not have any parameters, I might suggest adding parameters to it and leaving the current behavior (report out in seconds) as the default. See below for what I mean.
Installed from both the RStudio and CRAN repositories.
One note, I did not install from Source but rather from the binary and when I try to build it from source now I'm getting thrown an error.
So I think I may have isolated the issue. First this is the column of the data frame that I'm returning. Its a list of dates.
When I used
all returned information as expected.
Now, I then ran the wday, yday, mday with the column and again received the correct results back from the functions.
I then ran qday again on my column, got the same result back in a weird seconds based output. I then decided to try and coerce the column with an as.Date and voila! I get the expected results.
To confirm my theory, I took the actual date format that was used in the modelerData column and set a variable to it:
There seems to be some sort of error handling that exists in the other functions (or additional coding) that occurs within the qday function and when it hits this particular format YYYY-MM-DD tz it immediately throws an error. I'm not sure why it would return seconds when seeing a list or a column from a data frame and just error when one individual value is passed, but I think I have found the answer to my issue. I just need to coerce to a Date when using qday, but you may want to see what's going on underneath the hood.
The Test Case is as follows:
I've seen a similar behavior. Which is what brought me to this page.
I was using the code in this repository:
And noticed this problem on my Windows 7 computer.
However, when I ran similar code on my Macintosh computer. I had no problems. On my Windows 7 64bit computer. I'm also having problems reproducing this problem a second time. I'll keep my eyes open.
Count me as a second possible suspect report of this behavior.
And the author of the Create_Date_Tables_using_R as a possible third. He mentions in this post that he is having problems with qday()
I've been working for a while on my windows computer and it is now broken again. :-) I think I have a reproducible set of code. At the moment, I don't have any more time to continue the simplification process.
title: "R Notebook"
And a shorter version.
Note that yday() seem to be working OK. However, qdate() is reporting seconds in the quarter sort of +1.
dplyr version = 0.5.0
Hope this helps. Please let me know if anyone else is able to replicate. And or if there is something wrong with the way I'm creating the DateTable.
I've reproduced this on both Windows: