On 28-Jul-09 11:04:39, Andreas Posch wrote:
> I am trying to continuously evaluate online created data files using
> R-algorithms. Is there any simple way to let R iteratively check for
> new files in a given directory, load them and process them?
> 
> Any help would be highly appreciated.
> Best, A.

If in Linux/Unix, the following sort of thing will work:

  LastList <- system("ls",intern=TRUE)

then, later,

  NewList <- system("ls",intern=TRUE)

and then

  NewList[!(NewList %in% LastList)]

is a character vector of the names in NewList which are not in LastList
(i.e. the ones which have come in since LastList was created). Then you
can do what you like with these names.

Finally:

  LastList <- NewList

means you can repeat the check on the same basis.

Don't ask me how to do this in Windows ...

Hpoing this helps,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <ted.hard...@manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 28-Jul-09                                       Time: 12:24:42
------------------------------ XFMail ------------------------------

______________________________________________
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