extractDate: Extracts the date from the filename

View source: R/helpers.R

extractDateR Documentation

Extracts the date from the filename

Description

Extract the date in the filename and converts it into a POSIX object.

Usage

extractDate(x, split = "_", position = 2, as.POSIXlt = TRUE)

Arguments

x

filename

split

argument to isolate the date information default '_'

position

numeric default 2. Set the position of the date after the split was applied

as.POSIXlt

default TRUE

Value

If as.POSIXlt == FALSE a character string with the extracted date part If as.POSIXlt == TRUE a sting of POSIXlt objects string.

Author(s)

Matteo Mattiuzzi


MatMatt/clmsapi documentation built on Feb. 4, 2023, 9:08 a.m.