Hi I looked, but I didn't find it: I need an array [0 to 101] where each element is a list (the result of Kest in spatstat). I.e. I want to do: A[2] <- Kest(pp1) A[3] <- Kest(pp2) ... A[101] <- Kest(pp100) How can I create A ? Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Department of Conservation Ecology University of Stellenbosch Matieland 7602 South Africa
Probably, you could do it like A <- list() for( i in 1:101){ A[[i]] <- Kest( get( paste("pp",i,sep="") ) ) } Best, Matthias> Hi > > I looked, but I didn't find it: > > I need an array [0 to 101] where each element is a list (the > result of > Kest in spatstat). > I.e. I want to do: > > A[2] <- Kest(pp1) > A[3] <- Kest(pp2) > ... > A[101] <- Kest(pp100) > > How can I create A ? > > Rainer > > -- > Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation > Biology (UCT) > > Department of Conservation Ecology > University of Stellenbosch > Matieland 7602 > South Africa > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read > the posting guide! http://www.R-project.org/posting-guide.html >
a <- array(vector("list", 3), dim=c(3)) a[[1]] <- list(x = 1, y = 0, z = -1) a[[2]] <- list(x = 0, y = 1, z = -1) a[[3]] <- list(x = 0, y = -1, z = 0) HTH christoph Rainer M. Krug wrote:> Hi > > I looked, but I didn't find it: > > I need an array [0 to 101] where each element is a list (the result of > Kest in spatstat). > I.e. I want to do: > > A[2] <- Kest(pp1) > A[3] <- Kest(pp2) > ... > A[101] <- Kest(pp100) > > How can I create A ? > > Rainer >