To find the last accessed date of a directory in R, you can use the file.info()
function to get the file attributes of the directory and then extract the atime
attribute, which represents the last time the directory was accessed. Here's an example:
main.r387 chars15 lines
Note that the atime
attribute may not always be reliable, depending on the operating system and file system. In some cases, the mtime
(last modified time) or ctime
(last changed time) attributes may be more appropriate. You can access these attributes in the same way as the atime
attribute, by replacing atime
with mtime
or ctime
in the code above.
gistlibby LogSnag