Copying list of files from one folder to other in R

前端 未结 2 965
暗喜
暗喜 2020-12-17 15:42

I am trying to bulk move files of different kinds in R.

origindir <- c(\"c:/origindir\")
targetdir <- c(\"c/targetdir\")
filestocopy <- c(\"myfile.         


        
2条回答
  •  长情又很酷
    2020-12-17 16:23

    Just expanding Chase's suggestion.

    lapply(filestocopy, function(x) file.copy(paste (origindir, x , sep = "/"),  
              paste (targetdir,x, sep = "/"), recursive = FALSE,  copy.mode = TRUE))
    

提交回复
热议问题