plotConnectivityMatrix: Create a 'ggplot2' connectivity matrix plot object

View source: R/plotConnectivityMatrix.R

plotConnectivityMatrixR Documentation

Create a ggplot2 connectivity matrix plot object

Description

Function to create a ggplot2 connectivity matrix plot object.

Usage

plotConnectivityMatrix(
  tbl_conn,
  connPolys,
  maxVal = NA,
  valCol = "value",
  facetGrid = NULL,
  facetWrap = NULL,
  facetByRow = TRUE,
  nrow = NULL,
  ncol = NULL,
  setZeroToNA = FALSE,
  xlab = "end zone",
  ylab = "start zone",
  fill_lab = "value",
  fill_scale = ggplot2::scale_fill_viridis_c(option = "plasma", limits = c(0, maxVal)),
  legend.position = "right"
)

Arguments

tbl_conn

- tibble with connectivity values to plot

connPolys

- tibble representing the connectivity grid

maxVal

- max value for fill scale

valCol

- column name for values to plot

facetGrid

- formula for faceting variables using ggplot2::facet_grid

facetWrap

- column name(s) for faceting variable(s) using ggplot2::facet_wrap

facetByRow

- flag (T/F) to arrange wrapped facets by row

nrow

- number of rows to arrange wrapped facets in (if facetByRow is TRUE)

ncol

- number of columns to arrange wrapped facets in (if facetByRow is FALSE)

setZeroToNA

- flag (T/F) to set 0 values to NA's

xlab

- x axis label

ylab

- x axis label

fill_lab

- label for fill legend

fill_scale

- ggplot2 fill scale

legend.position

- string indicating legend position in theme

Details

Creates a ggplot2 plot object representing a connectivity matrix with start zones on the y axis and end zones on the x axis. The startZone and endZone columns of the connPolys dataframe should be factors, with levels corresponding to the order in which zones should be displayed.

Value

ggplot2 plot object


wStockhausen/rDisMELS documentation built on March 27, 2022, 1 a.m.