Working with Dates and Strings
In Chapter 5, you will learn how to work with dates and strings.
Recipe 5-1. Working with Dates and Times
When you import date and time data into R, these are not recognized automatically. To work with them, you must convert dates and times to the proper format.
The system’s idea of the current date is returned by the Sys.Date() function. You can retrieve the current date with the time by using the Sys.time() function. Examine the following examples.
> Sys.time() "2014-06-03 13:26:35.06454 EDT"> ## locale-specific version of date()> format(Sys.time(), "%a %b %d %X %Y") "Tue Jun 03 ...