I have thousands of text files and would like to know how to check if a particular file is empty. I am reading all the files using this line of code
Y<-grep(\
For a functional approach, you might first write a predicate:
file.empty <- function(filenames) file.info(filenames)$size == 0
And then filter the list of files using it:
Filter(file.empty, dir())