vec_cast.partial_time.character {parttime} | R Documentation |
Coerce character date representations to parttime objects
Description
Coerce character date representations to parttime objects
Usage
## S3 method for class 'partial_time.character'
vec_cast(x, to, ..., format = parse_iso8601_datetime, on.na = warning)
Arguments
x |
Vectors to cast. |
to |
Type to cast to. If |
... |
Additional arguments passed to |
format |
a |
on.na |
a |
Value
A partial_time
vector
Examples
dates <- c(
NA,
"2001",
"2002-01-01",
"2004-245", # yearday
"2005-W13", # yearweek
"2006-W02-5", # yearweek + weekday
"2007-10-01T08",
"2008-09-20T08:35",
"2009-08-12T08:35.048", # fractional minute
"2010-07-22T08:35:32",
"2011-06-13T08:35:32.123", # fractional second
"2012-05-23T08:35:32.123Z", # Zulu time
"2013-04-14T08:35:32.123+05", # time offset from GMT
"2014-03-24T08:35:32.123+05:30", # time offset with min from GMT
"20150101T083532.123+0530" # condensed form
)
as.parttime(dates)
[Package parttime version 0.1.2 Index]