-
Notifications
You must be signed in to change notification settings - Fork 7
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
as.Date does not handle the case where tz is a vector #118
Comments
Could do. Do you have a use case for that? |
Yes, I recently had a set of observations over a couple of months with UTC times, all with different geographical locations and needed to group the observations by day. I converted the geographical locations to timezones, but couldn't directly use |
Do you have a clever idea for how to do 'maybe-vectorization' ? Or maybe we already do elsewhere? (Asking because I thought 20 years ago it was an important feature over several args so I did a pretty ham-fisted set of nested loop and always wondered about 'better' way....) |
Fortunately, we've already got some vectorization for this at C level, so it turns out to be fairly straightforward. See if this new code seems OK to you. |
Really nice. I had one gut-instinct idea now but not strong feeling either way. With/without automagic tz works for me. |
We handle
tz
as a vector it correctly in the extract functions (nano_month
, etc.), but in ouras.Date
we convert first toPOSIXct
and then call the baseas.Date
. So the idea here is to use our own functions instead of relying onPOSIXct
.The text was updated successfully, but these errors were encountered: