[R] Copy and Rename Folder in same directory

Archit Soni soni.archit1989 at gmail.com
Mon May 8 12:59:32 CEST 2017


Hey Ben,

I tried this,

# identify the folders
current.folder <- "C:/Where my files currently live"
new.folder <- "H:/Where I want my files to be copied to"

# find the files that you want
list.of.files <- list.files(current.folder, "SDM\\.tif$",full.names=T)

# copy the files to the new folder
file.copy(list.of.files, new.folder)

But i am still getting FALSE and files are not getting copied from the
folder. However,if I give a single file name it copies that file to new
folder.

Any thoughts ?

On Mon, May 8, 2017 at 4:07 PM, Archit Soni <soni.archit1989 at gmail.com>
wrote:

> Thanks Ben. :)
>
> On May 8, 2017 16:06, "Ben Tupper" <btupper at bigelow.org> wrote:
>
>> Hi,
>>
>> Checkout all of the functions for file/directory management under ?files
>> (note the plural).
>>
>> Cheers,
>> Ben
>>
>>
>> > On May 8, 2017, at 6:30 AM, Archit Soni <soni.archit1989 at gmail.com>
>> wrote:
>> >
>> > Hello,
>> >
>> > Forgive me to ask this kind of naive question.
>> >
>> > But it would be of immense help if you could help me suggesting a way to
>> > copy a folder in the same directory and paste it in the same directory
>> with
>> > different name.
>> >
>> > Ex:
>> >
>> > C:/Folder A -- C:/Folder A_B
>> >
>> > Contents should be copied as is.
>> >
>> > Thanks for reading and thanks in advance!
>> >
>> > Archit
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> > ______________________________________________
>> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide http://www.R-project.org/posti
>> ng-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>>
>> Ben Tupper
>> Bigelow Laboratory for Ocean Sciences
>> 60 Bigelow Drive, P.O. Box 380
>> East Boothbay, Maine 04544
>> http://www.bigelow.org
>>
>>
>>
>>


-- 
Regards
Archit

	[[alternative HTML version deleted]]



More information about the R-help mailing list