On Tue, Jul 28, 2009 at 12:04 PM, Andreas Posch<andreas.po...@tugraz.at> 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.

 list.files(dir) will tell you what files are in a directory.

 file.info(filepath) will tell you things about a file (modification time etc).

 Sys.sleep(n) will put R to sleep for n seconds so you don't have a
tight loop checking the directory every millisecond.

That's probably all the functionality you need, except maybe to keep
track of what files you consider 'new', and some way of deciding if
something has already been processed. But that's a bit
application-specific!

Barry

______________________________________________
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