Description Usage Arguments Details Value Note Examples
Robust conversion of variably formatted characters to dates
1 |
x |
vector of character dates |
orders |
|
year |
4 digit integer, the oldest year expected in |
tz |
time zone of output; default is GMT (in GMT no times missing due to daylight savings, so more robust) |
... |
arguments to pass to |
See lubridate::parse_date_time
for a summary of how to specify orders
. Examples show a conversion of variable formats. The only reason this function exists is that parse_date_time
did not handle the century very well on some test data.
The default orders
is
paste0(
rep(c("ymd", "mdy", "Ymd", "mdY"),each=5),
c(" HMS"," HM", " H", "M", "")
)
a vector of dates formatted as POSIXct
In 2056 I will turn 70. At that point, I'll still be able to assume that a date of '57 associated with an ecological field observation was probably made in 1957. If I see '56, I'll round it up to 2056. I'll probably retire by the time I'm 70, or hopefully someone else will have cleaned up the date formats in all ecological data sets by that time. Either way, it is in my own self interest to set the default as ‘year=1957'; I do not currently use very many data sets that begin before 1957 (and none of such vast size that I need computer code to automate the corrections), and as a result, the default 1957 will continue to work for me until I retire. After that, a date of ’57 that was actually taken in 2057 will have its date reverted to 1957. Shame on them.
Oh, and the oldest observation in this package is 1958, I believe (the soda bottom temperatures). As for trawl data, NEUS goes back to 1963. So 1957 is a date choice that will work for all dates currently in this package, and given a 1 year buffer, maximizes the duration of the appropriateness of this default for these data sets into the future.
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.