Skip to content
Prev 83317 / 398513 Next

Repeating functions

On 12/29/05 11:01 AM, "Kort, Eric" <Eric.Kort at vai.org> wrote:

            
To be just a bit more explicit, see (untested) code.  Lists are quite
powerful data structures, so learn to use them well.

 mygal_nb <- list()
 myweight <- list()
 for (i in 1:6) {
 mygal_nb[[i]] <- read.gal(mygalfile[i], override.id = TRUE)
 myweight[[i]] <- nb2listw(mygal_nb[[i]])
 }

Sean