Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

grow.rectangle

Add margins to rectangle


Description

Adds a margin to a rectangle.

Usage

grow.rectangle(W, xmargin=0, ymargin=xmargin, fraction=NULL)

Arguments

W

A window (object of class "owin"). Must be of type "rectangle".

xmargin

Width of horizontal margin to be added. A single nonnegative number, or a vector of length 2 indicating margins of unequal width at left and right.

ymargin

Height of vertical margin to be added. A single nonnegative number, or a vector of length 2 indicating margins of unequal width at bottom and top.

fraction

Fraction of width and height to be added. A number greater than zero, or a numeric vector of length 2 indicating different fractions of width and of height, respectively. Incompatible with specifying xmargin and ymargin.

Details

This is a simple convenience function to add a margin of specified width and height on each side of a rectangular window. Unequal margins can also be added.

Value

Another object of class "owin" representing the window after margins are added.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

w <- square(10)
  # add a margin of width 1 on all four sides
  square12 <- grow.rectangle(w, 1)

  # add margin of width 3 on the right side
  # and margin of height 4 on top.
  v <- grow.rectangle(w, c(0,3), c(0,4))

  # grow by 5 percent on all sides
  grow.rectangle(w, fraction=0.05)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.