Re: [R] Create directory and copy files in R

2009-09-22 Thread milton ruser
Tammy Try avoid directories with spaces... may be this solve your problem. Case not, write us again. bests milton On Mon, Sep 21, 2009 at 10:05 AM, Tammy Ma wrote: > > > HI, All R users, > > My problem is: > > > fn > [1] "C:/Documents and > Settings/lma/Desktop/FamilyAEntrepreneurs/Entrepreneu

Re: [R] Create directory and copy files in R

2009-09-22 Thread Henrik Bengtsson
See copyDirectory() in the R.utils package. /hb On Tue, Sep 22, 2009 at 9:43 AM, Yihui Xie wrote: > You assigned values to 'fn' and 'dpath' outside the function body and > use these names as the arguments of your function, so actually 'cyfun' > does not know what 'fn' and 'path' are. The solution

Re: [R] Create directory and copy files in R

2009-09-22 Thread Yihui Xie
You assigned values to 'fn' and 'dpath' outside the function body and use these names as the arguments of your function, so actually 'cyfun' does not know what 'fn' and 'path' are. The solution is to put them in the arguments as default values: cyfun <- function(fn = "C:/Documents and Settings/lma

Re: [R] Create directory and copy files in R

2009-09-21 Thread Don MacQueen
In your file.copy() command you have "deskfile", but "deskfile" does not appear anywhere else. Perhaps you meant deskdir? After the error occurs, type traceback() and try to discern exactly where things went wrong. -Don At 5:05 PM +0300 9/21/09, Tammy Ma wrote: Content-Type: text/plain C

[R] Create directory and copy files in R

2009-09-21 Thread Tammy Ma
HI, All R users, My problem is: > fn [1] "C:/Documents and Settings/lma/Desktop/FamilyAEntrepreneurs/Entrepreneurs/Juha/book_log-20041210T095019.txt" > dpath [1] "C:/Documents and Settings/lma/My Documents/Juha/book" I want to make a function "cyfun" to copy all files in "dir" to "deskdir"