ahull: Maximum area given x and y coordinates

View source: R/hull.R

ahullR Documentation

Maximum area given x and y coordinates

Description

Present since hutils 1.2.0.

Usage

ahull(
  DT,
  x = DT$x,
  y = DT$y,
  minH = 0,
  minW = 0,
  maximize = "area",
  incl_negative = FALSE
)

Arguments

DT, x, y

Coordinates of a curve containing a rectangle. Either as a list, DT, containing columns x and y.

minH

The minimum height of the rectangles.

minW

The minimum width of the rectangles.

maximize

How the rectangle should be selected. Currently, only "area" supported.

incl_negative

Should areas below the x-axis be considered?

Value

A data.table: The coordinates of a rectangle, from (0, 0), (1, 0), (1, 1), (0, 1), south-west clockwise, that is contained within the area of the chart for positive values only.

Examples

ahull(, c(0, 1, 2, 3, 4), c(0, 1, 2, 0, 0))


hutils documentation built on April 13, 2022, 5:23 p.m.