normalizeDate: Reformat a Date String

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utils.R

Description

This method reformats a date string for R packages as these can be very heterogenous defined in the DESCRIPTION files of packages.

Usage

1
2
3
4
normalizeDate(d, asDate = TRUE, months = c(jan = "january", feb =
  "februrary", mar = "march", apr = "april", may = "may", jun = "june", jul
  = "july", aug = "august", sep = "september", oct = "october", nov =
  "november", dec = "december"))

Arguments

d

(character) The date to be converted.

asDate

(boolean) Return as R "Date" representation (TRUE) or as character string (FALSE).

months

(object) The name of the year's month.

Value

(see Parameter asDate) Reformatted date.

Author(s)

Matthias Pfeifer matthias.pfeifer@roche.com

See Also

as.Date

Examples

1
2
3
new_date <- normalizeDate("15.September.2018",FALSE)

stopifnot(new_date=="15.09.2018")

RTest documentation built on Dec. 4, 2019, 5:07 p.m.