title: How to copy a folder / directory with symbolic links in R?
body: <p>I have an R function that uses a directory with relative symbolic links (e.g. <code>../../data</code>) as a template. I know the relative links will be valid since the function puts the template in a specific part of a known file structure. The <code>file.copy</code> function can copy directories with <code>recrusive = TRUE</code>, but it turns the symbolic links into copies of the directories they point to. The linux system command <code>cp -r path1 path2</code> will copy the links correctly, but I want to use R functions when possible. </p>
  
  <p>How do I copy a directory in R that contains relative symbolic links that point outside the directory? </p>
  
  <p>I know I could write my own function that recursivly lists files (<code>list.dirs</code>), finds symbolic links (<code>Sys.readlink</code>), and recreates them (<code>file.link</code>), while copying all other files, but I wanted to know if that functionality already exists. </p>