-
Notifications
You must be signed in to change notification settings - Fork 207
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
QDay Reporting in Number of Seconds #543
Comments
Hi, I don't see this. qday(now())
[1] 37 What version is this? My guess is that this has been fixed ages ago. |
@vspinu
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. |
Quick Update: I compiled from the Source and got the same issue. |
Can you provide a reproducible example? What does the |
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 see, x is character. You should always create POSIXct to avoid surprising results related to timezones. It still doesn't explain why you get seconds on that column. What is the class of that column? Can you do |
I've seen a similar behavior. Which is what brought me to this page. I was using the code in this repository: https://github.com/DieselAnalytics/Create_Date_Table_Using_R.git 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() https://github.com/DieselAnalytics/Create_Date_Table_Using_R/issues/1 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:
and Macintosh
|
Ok, so it's a character input. It was somewhat by accident that other accessors worked as those functions were not intended to work with strings. Anyways, I made |
Cool, Thank You. What CRAN version is likely to have this new feature? |
Within a week or two. I still need to fix a couple of issues out there. |
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.
The text was updated successfully, but these errors were encountered: