Skip to contents

type = "links" shows the longest links of the minimum spanning tree (the jump at L separates sampling gaps from gaps between separate parts of the range); type = "clusters" shows the number of clusters as a function of the linking distance. Dashed lines mark L (and L2).

Usage

plot_linking(
  x,
  type = c("links", "clusters"),
  n_links = 40,
  base_size = 11,
  file = NULL,
  width = 2400,
  height = 1800
)

Arguments

x

An m_linking object from linking_distance() or an m_area.

type

"links" or "clusters".

Number of longest links shown.

base_size

Base font size.

file

Optional file(s) to save the plot to, e.g. "fig.pdf" or c("fig.png", "fig.pdf"); the format follows the extension, and a name without extension is saved as PNG and PDF. The plot is also returned.

width, height

Size of the saved figure in pixels (PDF and SVG at 300 pixels per inch).

Value

A ggplot object.

Examples

sim <- simulate_enm_data(seed = 1, n_presence = 150)
lk <- linking_distance(sim$presence, thin_km = 5, link_search = c(20, 200))
plot_linking(lk)

plot_linking(lk, "clusters")