splitDate: splitDate - Generates a vector of date and time components

View source: R/rutils.R

splitDateR Documentation

splitDate - Generates a vector of date and time components

Description

splitDate - Generates a vector of date and time components, perhaps for inclusion in filenames or other labels; helpful for keeping different run outputs seperate and identifiable.

Usage

splitDate(dat = NA)

Arguments

dat
  • a system time from Sys.time() to be broken in components; defaults to NA, whereupon the current time is used.

Value

a vector od characters relating to 'Year', 'Month', 'Day','Time', and a DateTime, which is a combination of all of these suitable for inclusion in a filename.

Examples

## Not run: 
tmp <- splitDate()
print(tmp)
print(names(tmp))
print(as.numeric(tmp[1:3]))
print(tmp["DateTime"])

## End(Not run)

haddonm/codeutils documentation built on April 15, 2024, 1:02 p.m.