Hi there,
someone could explain me why the function below   returns different answer
when I use the line from "nnwhich(ppp_viz$marks..." to just
"nnwhich(ppp_viz...)"?


setwd("")
require(spatstat)
require(foreign)
require(maptools)
options(digits=22)

x<- c(1,1,2,3,5,7)
y<-c(1,2,3,3,2,9)
z<-factor(c("pro heb","pro heb","aba jup","oco cer","Esc cor", "bro rub"))
wind<-square(10)
W<-as(wind,"owin")
#using ppp_viz$marks
    ppp_viz<-ppp(x,y,window=W, marks= z)

    viz <- vector(length = 4, mode = 'list')
    for (k in 1:4) viz[[k]] <- nnwhich(ppp_viz$marks, k = k)

    names(viz) <- paste('k', 1:4)
    str(viz)
##########without specifying "marks"

viz <- vector(length = 4, mode = 'list')
    for (k in 1:4) viz[[k]] <- nnwhich(ppp_viz, k = k)

    names(viz) <- paste('k', 1:4)
    str(viz)

Thanks

-- 
Kátia Emídio da Silva DSc
Eng. Florestal
Pesquisador
Embrapa Amazônia Ocidental

Forestry Engineer
Researcher at Brazilian Agricultural Research Corporation
 Embrapa western Amazon
Manaus/AM-Brazil

	[[alternative HTML version deleted]]

