I am creating a process report from a routine, a simplified "logfile", and would like to store the date at the time of the error in a variable.
What function does the current date and time result in #R?
I am creating a process report from a routine, a simplified "logfile", and would like to store the date at the time of the error in a variable.
What function does the current date and time result in #R?
The function that does this is Sys.time()
. It returns the date and time, along with timezone.
> Sys.time()
[1] "2016-03-08 07:11:57 BRT"
If you just want the date, you can use the Sys.Date()
function.
> Sys.Date()
[1] "2016-03-08"