Comments (1)
That's an R thing I can do nothing about. A vector is forced / required / defined to be of one type, and (AFAIK) the first value determines the type for the whole vector. anytime()
and anydate()
then receive that vector (as a whole) and do operations given the representation type of the vector.
I am fairly sure we discussed this here before so you may additional information if you search among the closed issues.
The other issue is that initially we took a numeric
(as in your vec2
) to be a 'transcribed' character (as here) and reconverted to char. Turns out that is a bad idea because we really need to be like R itself and treat 5
(or 5L
) as the offset to the epoch so that anydate(5)
gets us Jan 6, 1970. But because honour old behaviour and APIs we added an option oldHeuristic
-- but apparently only for anytime
:
> anytime(20120213, oldHeuristic=TRUE)
[1] "2012-02-13 CST"
>
If you want to port that to anydate
or shimmy something else in please follow up with a proposal. Otherwise I think we can close this. If you disagree, or have other material, please feel free to reopen. Thanks of trying anytime
!
PS This works:
> anydate(anytime(20120213, oldHeuristic=TRUE))
[1] "2012-02-13"
>
PPS I was not quite correct on oldHeuristic
. It is related to char <-> numeric
but the values you have here don't fly, we get bad values. The overall issue remains: you may need to take care of leading NA
values.
from anytime.
Related Issues (20)
- Cannot use both tz and useR=TRUE arguments
- Strange issue - anydate does not recognize format or ... ? HOT 3
- UK v US formats HOT 2
- Process only unique values for speed, please :) HOT 27
- Time is silently scrubbed when using certain string date time formats HOT 3
- Add argument for default MM/DD to add to just YYYY inputs HOT 1
- timedatectl problem on HPC? HOT 2
- Failed to activate service 'org.freedesktop.timedate1' on Google Cloud VM HOT 9
- month year specification HOT 7
- Could anydate support nanotime ? HOT 4
- Returning NA value HOT 3
- Feature requests: more flexibly find date substring in a non-date string; and process additional incomplete date substrings HOT 11
- European vs US date formats HOT 3
- Feature request: function to return which format was recognized. HOT 3
- Anytime errors with length 1 NA HOT 6
- Chinese date format suggestion HOT 3
- just yyyy-mm-dd hh:mm:ss but not AEST suffix HOT 5
- anytime() sometimes returns the wrong date HOT 2
- single digit dates with unambiguous month and year HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anytime.