Hello Duncan,

Jeff's tweaks to my code has worked.   Now I am trying your way. Below are the 
R script and console.   The issue is that the object (list.of.files) has not 
been created.  Any thoughts?

Thanks,

###############  R script ##########################

#file.copy.dm.way.R

#identify the folders

fromFolder <- file.path("H:", "cis_study")

toFolder <- file.path("F:", "cis_study")

# find the list of files to copied
list.of.files <- list.files(fromFolder, ".R$")

# print objects
print(fromFolder, list.of.files, toFolder)

# copy the files
file.copy(list.of.files, toFiles)

###############  console ###############
> #file.copy.dm.way.R
> 
> #identify the folders
> 
> fromFolder <- file.path("H:", "cis_study")
> 
> toFolder <- file.path("F:", "cis_study")
> 
> # find the list of files to copied
> list.of.files <- list.files(fromFolder, ".R$")
> 
> # print objects
> print(fromFolder, list.of.files, toFolder)
Error in print.default(fromFolder, list.of.files, toFolder) : 
  invalid 'digits' argument
> 
> # copy the files
> file.copy(list.of.files, toFiles)
logical(0)

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to