Skip to content
Prev 43879 / 398528 Next

iterating over files in a directory with R

On Sun, 8 Feb 2004 16:07:44 -0500, you wrote:

            
The apply() and related functions do iteration over various things,
and list.files() and choose.files() select files (the latter
interactively on Windows).

So something like this might do what you want:

 lapply(list.files(), function(x) paste('filename is ',x))

Duncan Murdoch