convertToDateTime: Convert character vector to date/time object

View source: R/loadDataADaMSDTM.R

convertToDateTimeR Documentation

Convert character vector to date/time object

Description

Convert character vector to date/time object

Usage

convertToDateTime(
  x,
  format = c("%Y-%m-%dT%H:%M", "%Y-%m-%d"),
  colName = NULL,
  verbose = TRUE
)

Arguments

x

character vector to convert to date/time

format

string with possible format(s) of the input date/time in the ADaM dataset. If multiple are specified, each format is tested successively, until at least one element in the input vector is converted with the specified format (non missing, following the approach described in the format parameter of the strptime function). See the 'Details' section of the help of the function, for more information about this format.

colName

string with name of column, used in message (if any).

verbose

logical, if TRUE (by default) progress messages are printed during execution

Value

Vector of class POSIXct

Author(s)

Laure Cougnaud


clinUtils documentation built on Jan. 6, 2023, 5:29 p.m.