# NOT RUN {
x <- y <- matrix( 0, 50, 50)
x[ sample(1:50,10), sample(1:50,10)] <- rexp( 100, 0.25)
y <- disk2dsmooth( x=x, lambda=6.5)
x <- gauss2dsmooth( x=x, lambda=3, nx=25, ny=25)
# }
# NOT RUN {
##
## The following examples are specific to the SpatialVx package.
##
par( mfrow=c(1,2))
image.plot( x, col=tim.colors(256))
image.plot( y, col=tim.colors(256))
hold <- make.SpatialVx(x, y, thresholds=c(0.1, 0.5))
look <- hoods2d( hold, which.methods=c("fss"), levels=c(1, 3, 20),
smooth.fun="gauss2dsmooth", smooth.params=list(nx=601, ny=501))
plot( look)
data(pert000)
data(pert004)
data(ICPg240Locs)
# Do the neighborhood methods with averaging performed over
# a radius instead of the lambda^2 nearest neighbors.
# The smoothing parameters are determined by the levels argument,
# and the others are passed via smooth.params.
hold <- make.SpatialVx( pert000, pert004, thresholds=c(1,2,5,10,20,50),
loc=ICPg240Locs, projection=TRUE, map=TRUE,
field.type="Precipitation", units="mm/h",
data.name=c("ICP Fake", "pert000", "pert004"))
look <- hoods2d(hold, levels=c(1, 3, 9, 17, 33, 65, 129, 257),
smooth.fun="disk2dsmooth", verbose=TRUE)
look
# }
Run the code above in your browser using DataLab