Skip to content
Prev 275197 / 398503 Next

cycling through a long list of files and names

The more R way to do something like this is to put all your dataframes into a list and then run

lappy(cityList, dataCleaning) # for example

To get them into a list in the first place try this

n = 1997:2011
cityList <- vector(length(n), 'list')
for (i in n){
    cityList[[i]] <- get(paste("city", i, sep="")
}

Hope this helps,

Michael
On Oct 22, 2011, at 3:13 PM, Wet Bell Diver <wetbelldiver at gmail.com> wrote: