title: Copying list of files from one folder to other in R
body: <p>I am trying to bulk move files of different kinds in R. </p>
  
  <pre><code>origindir &lt;- c("c:/origindir")
  targetdir &lt;- c("c/targetdir")
  filestocopy &lt;- c("myfile.doc", "myfile.rda", "myfile.xls", 
                   "myfile.txt", "myfile.pdf", "myfile.R")
  </code></pre>
  
  <p>I tried the following, but do not know how to do for all files:</p>
  
  <pre><code>file.copy(paste (origindir, "myfile.doc", sep = "/"), 
            paste (targetdir, "myfile.doc", sep = "/"), 
            overwrite = recursive, recursive = FALSE, 
            copy.mode = TRUE)
  </code></pre>
  
  <p>I do not know how to do this. </p>