Moving files between folders

后端 未结 5 477
故里飘歌
故里飘歌 2020-12-02 18:30

I want to copy/paste a file from one folder to another folder in windows using R, but it\'s not working. My code:

> file.rename(from=\"C:/Users/msc2/Desk         


        
5条回答
  •  悲哀的现实
    2020-12-02 18:56

    You can try the filesstrings library. This option will move the file into a directory. Example code:

    First, we create a sample directory and file:

    dir.create("My_directory")
    file.create("My_file.txt")
    

    Second, we can move My_file.txt into the created directory My_directory:

    file.move("My_file.txt", "My_directory")
    

提交回复
热议问题