[Raster-commits] r193 - in pkg/raster: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jan 27 10:33:01 CET 2009
Author: jacobvanetten
Date: 2009-01-27 10:33:01 +0100 (Tue, 27 Jan 2009)
New Revision: 193
Modified:
pkg/raster/R/adjacency.R
pkg/raster/man/adjacency.Rd
Log:
adjacency doc
Modified: pkg/raster/R/adjacency.R
===================================================================
--- pkg/raster/R/adjacency.R 2009-01-27 09:19:10 UTC (rev 192)
+++ pkg/raster/R/adjacency.R 2009-01-27 09:33:01 UTC (rev 193)
@@ -251,8 +251,6 @@
return(fromto)
}
-
-
.adjBishop <- function(raster, fromCells, toCells, outerMeridianConnect) {
nCols <- ncol(raster)
nCells <- ncell(raster)
Modified: pkg/raster/man/adjacency.Rd
===================================================================
--- pkg/raster/man/adjacency.Rd 2009-01-27 09:19:10 UTC (rev 192)
+++ pkg/raster/man/adjacency.Rd 2009-01-27 09:33:01 UTC (rev 193)
@@ -20,6 +20,7 @@
Cell numbers start with 1 in the upperleft corner and increase from left to right and from top to bottom.
Number of directions: 4 connects cells with one-cell rook moves, 8 with one-cell queen moves, and 16 with knight and one-cell queen moves.
Bishop connects cells with one-cell diagonal moves (special cases).
+The function connects the outer meridians if the raster is in a geographic (latlon) projection and longitudes between -180 and 180 degrees are covered.
}
\value{
@@ -30,6 +31,8 @@
\examples{
rs <- newRaster(nrows=10, ncols=10)
adj <- adjacency(raster = rs, fromCells = c(1,30,55,72,100), toCells = c(1:ncell(rs)), directions=4)
+
+ #Visualize the outcome in a raster
v <- vector(length=ncell(rs))
v[adj[,2]] <- 2
v[adj[,1]] <- 1
More information about the Raster-commits
mailing list