Kulibo
Kulibo

Reputation: 91

Copy A Folder With A Subfolders in R

I have a folder containing several subfolders. I just want to copy the whole folder with all subfolders and containing subfiles. Is there a simpler way then using file.copy() for each single subfolder? A more advanced function?

Upvotes: 1

Views: 1878

Answers (1)

RishiG
RishiG

Reputation: 2830

If you have a relatively recent version of r, you can use file.copy(dir1,dir2,recursive=TRUE). For older versions you had to use system(paste("cp -r ",dir1,dir2)).

Upvotes: 1

Related Questions