Displaying 2 results from an estimated 2 matches for "nbmat".
Did you mean:
bmat
2009 Jan 28
1
Neighborhood distance calculator
...er
{
#data has the x and y on the first two columns. Could have more than
two columns, or exactly two columns, it doesn't matter.
#produces a "list" object with a vector of the neighbors for each location
#distance defines the range within which we define neighbors
nd=length(data[,1])
nbmat=list(array)
dist=pairdist(data[,1:2])
for(i in 1:nd){
nbmat[[i]]=0
for(j in 1:nd) if((dist[i,j]<distance)&(i!=j)) nbmat[[i]]=c(nbmat[[i]],j)
nbmat[[i]]=nbmat[[i]][nbmat[[i]]!=0]}
return(nbmat)
}
---------------------------------------------------------------------------------------...
2009 Jan 28
2
t.test in a loop
Hi All,
I've been having a little trouble with creating a loop that will run a a
series of t.tests for inspection,
Below is the code i've tried, and some checks i've looked at.
I've used the get(paste()) idea as i was told previously that the use of the
eval should try and be avoided.
I've run a single syntax to check that my systax is correct and works
without any problems