Learn R Programming

parttime (version 0.1.2)

parse_cdisc_datetime: Parse cdisc datetime strings as parttime matrix

Description

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)

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

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.

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

References

CDISC SDTMIG v3.4

"ISO_8601" on Wikipedia