12.07.2015 Views

R dummies

R dummies

R dummies

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

values that indicate the number of seconds since a specific instant in time(known as the epoch).In R, you can use two functions to work with datetime objects: POSIXct()and POSIXlt(). These functions create objects of class POSIXct and POSIXlt,respectively:POSIXct objects represents the (signed) number of seconds since thebeginning of 1970 (in the UTC time zone) as a numeric vector.POSIXlt objects are named lists of vectors representing nine elements ofa datetime (sec, min, hour, and so on).Because POSIXct are numbers, and POSIXlt objects are lists, POSIXct objectsrequires less memory.The following table summarizes the main differences between the differentdatetime classes in R.ClassDescriptionUsefulFunctionsDate Calendar date as.Date()POSIXctThe number of seconds since the beginning of 1970 (in theUTC time zone) as a numeric vectoras.POSIXct()POSIXltA named list of vectors representing nine elements (sec, min,hour, and so on)as.POSIXlt()

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!