Skip to contents

Parse cdisc datetime strings as parttime matrix

Parse iso8601 datetime strings as parttime matrix

Parse iso8601 datetime strings as timespan array

Parse a character vector to create a matrix of datetime fields

Usage

parse_cdisc_datetime(x, warn = TRUE, ...)

parse_iso8601_datetime(x, warn = TRUE, ...)

parse_iso8601_datetime_as_timespan(x, ...)

parse_to_parttime_matrix(dates, regex = re_iso8601)

Arguments

x

A character vector of iso8601 datetime strings

warn

A logical indicating whether to warn when information would be loss when coercing to a parttime matrix.

...

Additional arguments unused

dates

character vector of dates to parse for iso8601 components

regex

A regular expression used for parsing parttime strings. Defaults to a parser for the ISO8601 standard. Should include named capture groups for each datetime field. See Details for more information.

Value

A matrix of capture fields discovered while parsing CDISC-style datetimes.

A matrix of capture fields discovered while parsing ISO8601-style datetimes.

A character matrix of capture fields provided by the provided regular expression

Details

A format regular expression should separate the components of a valid datetime string, capturing strings which can be coerced to numeric values for each of the nine datetime fields:

  • year

  • month

  • day

  • hour

  • min

  • sec

  • tzhour

Note

A timespan array is an internal data structure used as the backend representation of timespan objects. It consists of two parttime-like matrices (with the addition of an "inclusive" column), one for the lower- and upper-bounds of the timespan. Collectively, this amounts to a three dimensional array.