Learn R Programming

splusTimeDate (version 1.5.0-72)

mdy: Return Various Periods from a Time Vector

Description

Returns data frames containing various periods from a time vector as integers.

Usage

mdy(x) 
hms(x) 
wdydy(x)

Arguments

x
the time object to extract calendar periods from.

Value

  • returns a data frame containing the periods as integers.

Details

  • mdyreturns a data frame with three columns:
    • month(1 - 12).
    • day(1 - 31).
    • year(for example, 1998).
  • hmsreturns a data frame with four columns:
    • hour(0 - 23).
    • minute(0 - 59).
    • second(0 - 59).
    • ms(0 - 999).
  • wdydyreturns a data frame with three columns:
    • weekday(0 - 6, with 0 meaning Sunday and 6 meaning Saturday).
    • yearday(0 - 366).
    • year(for example, 1998).

See Also

hours, days.

Examples

Run this code
x <- timeDate(c("1/1/1998 3:05:23.4", "5/10/2005 2:15:11.234 PM")) 
mdy(x) 
hms(x) 
wdydy(x)

Run the code above in your browser using DataLab