is_valid_date_str: Returns TRUE if the string is a valid date.

View source: R/is_valid_date_str.R

is_valid_date_strR Documentation

Returns TRUE if the string is a valid date.

Description

Returns TRUE if the string is a valid date.

Usage

is_valid_date_str(
  date_str,
  format = "%d-%m-%Y %H:%M:%S",
  optional = FALSE
)

Arguments

date_str

character vector with 0 or more dates

format

character vector of lenght one having the date format

optional

parameter to as.Date. Logical value indicating to return NA (instead of signaling an error) if the format guessing does not succeed. descriptor. Defaults to FALSE.

Examples

is_valid_date_str(c("13-21-1995", "20-13-98", "5-28-1014",
  "1-21-15", "2-13-2098", "25-28-2014"), format = "%m-%d-%y")


rmsharp/rmsutilityr documentation built on Feb. 13, 2024, 6:01 p.m.