Skip to content
Prev 81658 / 398502 Next

'For each file in folder F do....'

On 11/27/2005 3:51 PM, Ron Piccinini wrote:
From the look of it, the listfiles column that you created has been 
converted to a factor.  You can convert back to character using 
as.character(); the as.is=TRUE parameter in the file reading functions 
will prevent the conversion in the first place, if that's how it happened.

Then something like

results <- list()
for (f in as.character(listfiles[,1])) results[[f]] <- read.table(file=f)

will read all the files and put them in a list.

Duncan Murdoch