standardize_date: Standardize Date Format

standardize_dateR Documentation

Standardize Date Format

Description

This function attempts to parse a date string using multiple formats and standardizes it to "YYYY-MM-DD". It first tries ISO 8601 formats, and then common formats like ymd, dmy, and mdy.

Usage

standardize_date(date_str)

Arguments

date_str

A character string representing a date.

Value

A character string representing the standardized date in "YYYY-MM-DD" format, or NA if the date cannot be parsed.


textpress documentation built on Oct. 14, 2024, 5:08 p.m.