Learn R Programming

henna (version 0.3.4)

splitHull: Split the convex hull in four parts along two input lines

Description

This function splits the convex hull in two parts along a vertical and a horizontal line.

Usage

splitHull(
  p,
  pointsDF,
  hullSegments,
  xInt = NULL,
  yInt = NULL,
  lineColor = "navy",
  lineWidth = 0.3,
  lineType = c("dashed", "solid", "dotted", "dotdash", "longdash", "twodash"),
  legendLabs = paste0("Group ", seq(4)),
  alpha = 0.2
)

Value

An object of class gg showing the hull split along the input axes.

Arguments

p

A ggplot object representing the hull.

pointsDF

A data frame with the x and y coordinates of the points.

hullSegments

Data frame of segments that define the convex hull.

xInt

The coordinate where the vertical line intersects the x axis.

yInt

The coordinate where the horizontal line intersects the y axis.

lineColor

The color of the horizontal and vertical dividing lines, if provided. If NULL, no dividing lines will be drawn, though the hull will still be split along these lines if xInt and/or yIntare not NULL.

lineWidth

The width of the horizontal and vertical dividing lines. Ignored if lineColor is NULL.

lineType

The type of the horizontal and vertical dividing lines. Choose between 'dashed','solid', 'dotted', 'dotdash', 'longdash' and 'twodash'. Default is 'dashed'. Ignored if lineColor is NULL.

legendLabs

Legend labels.

alpha

Opaqueness level.