# shift.owin

From spatstat v1.20-2
by Adrian Baddeley

##### Apply Vector Translation To Window

Applies a vector shift to a window

##### Usage

```
## S3 method for class 'owin':
shift(X, vec=c(0,0), ..., origin=NULL)
```

##### Arguments

- X
- Window (object of class
`"owin"`

). - vec
- Vector of length 2 representing a translation.
- ...
- Ignored
- origin
- Character string determining a location
that will be shifted to the origin. Options are
`"centroid"`

,`"midpoint"`

and`"bottomleft"`

. Partially matched.

##### Details

The window is translated by the vector `vec`

.
This is a method for the generic function `shift`

.

If `origin`

is given, then it should be one of the character
strings `"centroid"`

, `"midpoint"`

or `"bottomleft"`

.
The argument `vec`

will be ignored; instead the shift will be performed
so that the specified geometric location is shifted to the origin.
If `origin="centroid"`

then the centroid of the window will be
shifted to the origin. If `origin="midpoint"`

then the centre of
the bounding rectangle of the window will be shifted to the origin.
If `origin="bottomleft"`

then the bottom left corner of the
bounding rectangle of the window will be shifted to the origin.

##### Value

- Another window (of class
`"owin"`

) representing the result of applying the vector shift.

##### See Also

##### Examples

```
W <- owin(c(0,1),c(0,1))
X <- shift(W, c(2,3))
plot(W)
# no discernible difference except coordinates are different
shift(W, origin="mid")
```

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

### Community examples

Looks like there are no examples yet.