# spatdim

##### Spatial Dimension of a Dataset

Extracts the spatial dimension of an object in the spatstat package.

##### Usage

`spatdim(X, intrinsic=FALSE)`

##### Arguments

- X
Object belonging to any class defined in the spatstat package.

- intrinsic
Logical value indicating whether to return the number of intrinsic dimensions. See Details.

##### Details

This function returns the number of spatial coordinate dimensions
of the dataset `X`

. The results for some of the more common
types of objects are as follows:

object class |
dimension |

`"ppp"` |
2 |

`"lpp"` |
2 |

`"pp3"` |
3 |

`"ppx"` |
number of spatial dimensions |

`"owin"` |
2 |

`"psp"` |
2 |

Note that time dimensions are not counted.

Some spatial objects are lower-dimensional subsets of the
space in which they live. This lower number of dimensions
is returned if `intrinsic=TRUE`

. For example, a dataset
on a linear network
(an object `X`

of class `"linnet", "lpp", "linim", "linfun"`

or `"lintess"`

) returns `spatdim(X) = 2`

but
`spatdim(X, intrinsic=TRUE) = 1`

.

If `X`

is not a recognised spatial object, the result is `NA`

.

##### Value

An integer, or `NA`

.

##### Examples

```
# NOT RUN {
spatdim(lansing)
A <- osteo$pts[[1]]
spatdim(A)
spatdim(domain(A))
spatdim(chicago)
spatdim(chicago, intrinsic=TRUE)
# }
```

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