Hi all,

I have two rasters with the same extent and resolution, similar to these
two:

raster2 <- raster1 <- raster(ext=extent(-1.95214, -1.69421, 55.60090,
55.72476), crs="+proj=longlat +ellps=WGS84 +datum=WGS84", ncol=50, nrow=50)

I also have two data frames with point locations (of the species Brent
Goose) similar to these two:

df1 <- data.frame(long=rnorm(100, -1.76901, 0.05),
                  lat=rnorm(100, 55.62953, 0.05))
coordinates(df1) <- c('long', 'lat')
proj4string(df1) <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84²)

df2 <- data.frame(long=rnorm(100, -1.90490, 0.05),
                  lat=rnorm(100, 55.69847, 0.05))
coordinates(df2) <- c('long', 'lat')
proj4string(df2) <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84")

I have assigned TRUE to raster cells which contain a point as follows:

raster1[cellFromXY(raster1, df1)] <- TRUE
raster2[cellFromXY(raster2, df2)] <- TRUE

For any cells that are NA in raster1, I need to assign them to TRUE if the
following condition is met: a TRUE raster2 cell in within 3km of a TRUE
raster1 cell.

Is this possible? Let me know if my question is unclear.

Ross









	[[alternative HTML version deleted]]

