# setmarks

From spatstat v1.9-2
by Adrian Baddeley

##### Set or Reset the Marks in a Point Pattern

Create a marked point pattern from given point locations and given marks.

##### Usage

```
setmarks(X, m)
X %mark% m
```

##### Arguments

- X
- Point pattern (object of class
`"ppp"`

) - m
- Vector of mark values (of any atomic mode)

##### Details

This function is a shortcut which creates a marked point pattern
from a given point pattern `X`

and a given vector `m`

by attaching the marks in `m`

to the locations of the points
in `X`

.

If `X`

is already a marked point pattern, then its marks
are ignored and replaced by the values in `m`

.

If `m`

is a single value, then all points will be
given this mark value. Otherwise, `m`

must be a vector
of length equal to the number of points in `X`

, and
the point `X[i]`

will receive the mark `m[i]`

.

Use `unmark`

to remove marks.
Use `ppp`

to create point patterns in more general
situations.

##### Value

- Marked point pattern (object of class
`"ppp"`

) identical to`X`

except that it has marks equal to`m`

.

##### synopsis

setmarks(X, m)

##### See Also

##### Examples

```
data(cells)
m <- runif(cells$n)
Y <- setmarks(cells, m)
Y <- cells %mark% m
# equivalent
plot(Y)
is.marked(Y) #TRUE
```

*Documentation reproduced from package spatstat, version 1.9-2, License: GPL version 2 or newer*

### Community examples

Looks like there are no examples yet.