Hi, It seems file.remove can't remove directories, regardless whether it's an empty one, but how to delete a directory in R > file.remove("D:/ffdata") [1] FALSE Warning message: In file.remove("D:/ffdata") : cannot remove file 'D:/ffdata', reason 'Permission denied' Thanks. Xiaobo Gu