# as.function.leverage.ppm

From spatstat v1.55-1
by Adrian Baddeley

##### Convert Leverage Object to Function of Coordinates

Converts an object of class `"leverage.ppm"`

to a function of the
\(x\) and \(y\) coordinates.

##### Usage

```
# S3 method for leverage.ppm
as.function(x, ...)
```

##### Arguments

- x
Object of class

`"leverage.ppm"`

produced by`leverage.ppm`

.- …
Ignored.

##### Details

An object of class `"leverage.ppm"`

represents the leverage
function of a fitted point process model. This command converts the object
to a `function(x,y)`

where the arguments `x`

and `y`

are (vectors of) spatial
coordinates. This function returns the leverage values at the
specified locations (calculated by referring to the nearest location
where the leverage has been computed).

##### Value

A function in the R language, also belonging to the
class `"funxy"`

.

##### See Also

##### Examples

```
# NOT RUN {
X <- rpoispp(function(x,y) { exp(3+3*x) })
fit <- ppm(X ~x+y)
lev <- leverage(fit)
f <- as.function(lev)
f(0.2, 0.3) # evaluate at (x,y) coordinates
y <- f(X) # evaluate at a point pattern
# }
```

*Documentation reproduced from package spatstat, version 1.55-1, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.