116 Spatial Point Patterns: Methodology and Applications with R
> X <- eval.im(Z + Y)
The argument of eval.im can be a ny R language expression in which the ‘variables’ are the n a mes
of pixel images. It may also involve the names of constants and functions, for example,
> eval.im(sqrt(Z))
> eval.im(sin(pi * Z))
> eval.im(Z > 3)
The exp ression can involve several images:
> eval.im(log(X) + Y - 3)
An im portant restriction is that the expression must operate ‘pixel-by -pixel’, in the sense that the
output has as many pixel values as the input:
> W <- eval.im(max(0,Z)) # Throws an error.
> W <- eval.im(pmax(0,Z)) # Works.
The first expression throws an error because it g ives a single value, whereas the second expression
gives the same number of pixel