I am trying to extract the name and properties of files in a folder. I am using the code below, which works well, except that it does not extract the file name in a column. The first column has the full path to the file, but is there a way to get the file name with extension (eg file1.pdf) in a separate column?
data_files <- file.info(list.files(path = choose.folder(),
full.names = T, recursive = T, pattern = ".pdf$", ignore.case = TRUE))
Update: I was told about this question which is similar: Find file name from full file path
which is similar but I still prefer the answers below as they are more detailed and explained the steps in more details.