search for: cell2nb

Displaying 10 results from an estimated 10 matches for "cell2nb".

Did you mean: cell2
2005 Aug 03
1
help for cell2nb and queencell in spdep package
...d R-users, I have a 5 by 5 grid, say, location[1:5,1:5], and I want to know the indices of 8 neighbours of each cell. For example, for location[2,2], its neighbour coordinates are [1,1:3], [2,1], [2,3] and [3,1:3]. Sometimes I also need to remove edge effects (torus = TRUE). I have tried "cell2nb" function in your spdep package. Here's my example: > neigh <- cell2nb(5,5,type="queen",torus=T) > neigh Neighbour list object: Number of regions: 25 Number of nonzero links: 200 Percentage nonzero weights: 32 Average number of links: 8 > neigh[1] [[1]] [1] 2 5 6...
2010 Jun 20
3
Spatial: number of independent components?
Hi all, I am sorry if this is a very basic quesion, but I have no experience with analyzing spatial data and could not find the right function/package quickly. Any hints would be much appreciated. I have a matrix of spatial point patterns like the one below and want to find the number of independent components (if that's the right term) in that matrix (or in that image). x=matrix(c(0,1,0,0,0,
2002 May 30
1
neighbor.grid and spatial.weights
Anyobody knows if functions neighbor.grid and spatial.weights (from module spatial) have any 'equivalents' in R ? Thanks. JA -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the
2004 Feb 19
1
How to create a "nb" object?
Hi group, I'd like to do spatial analysis of my data using the spdep package. It appears that a file of class nb is necessary, but I do not find what that should look like and if there is a function that creates such file for me. How can I create a nb-object of my data points? Thanks, René Eschen. [[alternative HTML version deleted]]
2011 Apr 19
1
SPDEP Package, neighbours list for Moran's I on large grid dataset
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20110419/a3438017/attachment.pl>
2012 Jul 12
0
How to handle NA-values in raster-based Geary´s C test?
...y much, Kerstin --- file<-raster(test.tif") mask<-extent(file, 1, 50, 1, 50) subset<-crop(file,mask,test.tif", overwrite=TRUE) value <- as.matrix(subset) # Creation of a list of integer vectors giving the region id numbers for the neighbors within the grid extent nb <- cell2nb(50, 50, type="queen", torus=TRUE) # Calculation of the distances along the links in the neighbous list dist <- nbdists(nb, coordinates(subset), longlat=TRUE) # Converting the distances to inverse distance values inv.dist <- lapply(dist, function (x) 1/(x*100)) # Supplementing the...
2006 Mar 14
1
help on moran's I index of point pattern, not areal pattern
hi,friends, we all know that moran's I index and Geary'C index can be used to test spatial autocorrelation in both the area data and point data, but i only can find something on how to calculate on the data of area, and can't find the methods to perform it on the point data, could anybody give me some information, thanks in advance! -- Kind Regards, Zhi Jie,Zhang ,PHD Department of
2011 Jul 12
1
Subsetting NaN values in localG()
...hich I already know to contain 25064 values): /counter = 1 diffD = array(0,25064) id = array(0,25064) for(i in 1:53235){ if(diffc[i]!=-999){ diffD[counter] = diffc[i] id[counter] = i counter = counter+1 } } ##Isolates values I want to use in localG calculation neigh = cell2nb(169,315,type=='queen') neigh2 = subset.nb(neigh,(1:length(neigh) %in% id) mylist = nb2listw(neigh2,style="B") stats = localG(diffD,mylist)/ Unfortunately, when I get to the last line of the code, I receive the following error: /"Error in matrix(0, nrow = nrow(x), ncol = nco...
2001 Oct 22
1
statistics for ragged arrays: loop to vector
Dear R users, I am currently writing a MCMC algorithm for spatial Poisson model. One problem which I need to solve is as follows: I have a vector X[1:J] which describes characteristics of cells of a rectangular grid. Further, for each cell I have a list of adjascent cells adj[] and the vector listing numbed of adjascent cells num[]. Thus if I want to list cells adjascent to cell i I write
2003 May 21
1
help on spatial data
Hi, I have a dataset with x and y coordinates and in each point I have an identity of point, in some cases I can have more then one identity by point. My dataset is something like this: > x <- rep(c(1:4),4) > y <- rep(c(1:4),c(4,4,4,4)) > area1 <- sample(factor(rep(c("a","b","c","d"),4))) > area2 <-