powered by
This function checks whether a given directory is empty or not.
is_dir_empty(path)
A logical value. Returns TRUE if the directory is empty, FALSE otherwise.
TRUE
FALSE
A character string specifying the path to the directory to check.
if (FALSE) { is_dir_empty("path/to/empty/directory") # Returns TRUE is_dir_empty("path/to/non-empty/directory") # Returns FALSE }
Run the code above in your browser using DataLab