To find the creation date of a file in R, you can use the file.info()
function to get the file attributes, and then extract the creation time from the resulting object using the attr()
function with the ctime
attribute:
main.r104 chars4 lines
This will give you the creation date and time of the file as a POSIXct object. If you want to format the date in a specific way, you can use the format()
function:
main.r70 chars2 lines
This will give you the date in the format "YYYY-MM-DD HH:MM:SS".
gistlibby LogSnag