Copy folders from one directory to another in R

前端 未结 3 1221
孤独总比滥情好
孤独总比滥情好 2021-02-18 13:06

I have two folders (say \"A\",\"B\") which are in a folder (say \"Input\"). I want to copy \"A\" and \"B\" to another folder (say \"Output\"). Can I do this in R?

3条回答
  •  青春惊慌失措
    2021-02-18 13:41

    All of the solutions I've seen to this question seem to imply a Unix based operating system (Mac & Linux). I think the reason that the response(s) didn't work for OP is that OP may be on Windows.

    In Windows, the definition of a file is just that, a file, whereas Unix defines a file as a file or directory. I believe this may be why file.copy() is not working, based on my understanding of the "File Manipulation" R documentation - arguments inputted to file.copy() for the "from" field must be files (not directories), but can be either files or directories for the "to" field.

提交回复
热议问题