# intensity.ppp

##### Empirical Intensity of Point Pattern

Computes the average number of points per unit area in a point pattern dataset.

- Keywords
- spatial, nonparametric

##### Usage

```
# S3 method for ppp
intensity(X, ..., weights=NULL)
```# S3 method for splitppp
intensity(X, ..., weights=NULL)

##### Arguments

- X
A point pattern (object of class

`"ppp"`

).- weights
Optional. Numeric vector of weights attached to the points of

`X`

. Alternatively, an`expression`

which can be evaluated to give a vector of weights.- …
Ignored.

##### Details

This is a method for the generic function `intensity`

.
It computes the empirical intensity of a point pattern
(object of class `"ppp"`

),
i.e. the average density of points per unit area.

If the point pattern is multitype, the intensities of the different types are computed separately.

Note that the intensity will be computed as the number of points
per square unit, based on the unit of length for `X`

,
given by `unitname(X)`

. If the unit of length is a strange multiple
of a standard unit, like `5.7 metres`

, then it can be converted
to the standard unit using `rescale`

. See the Examples.

If `weights`

are given, then the intensity is
computed as the total *weight* per square unit.
The argument `weights`

should be a numeric vector
of weights for each point of `X`

(weights may be negative or
zero).

Alternatively `weights`

can be an `expression`

which will be evaluated for the dataset to yield a vector of weights.
The expression may involve the Cartesian coordinates \(x,y\) of the
points, and the marks of the points, if any. Variable names
permitted in the expression include `x`

and `y`

,
the name `marks`

if `X`

has a single column of marks,
the names of any columns of marks if `X`

has a data frame of
marks, and the names of constants or functions that exist
in the global environment. See the Examples.

##### Value

A numeric value (giving the intensity) or numeric vector (giving the intensity for each possible type).

##### See Also

##### Examples

```
# NOT RUN {
japanesepines
intensity(japanesepines)
unitname(japanesepines)
intensity(rescale(japanesepines))
intensity(amacrine)
intensity(split(amacrine))
# numeric vector of weights
volumes <- with(marks(finpines), (pi/4) * height * diameter^2)
intensity(finpines, weights=volumes)
# expression for weights
intensity(finpines, weights=expression((pi/4) * height * diameter^2))
# }
```

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