View source: R/plotConnectivityMatrix.R
plotConnectivityMatrix | R Documentation |
Function to create a ggplot2 connectivity matrix plot object.
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" )
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 |
facetWrap |
- column name(s) for faceting variable(s) using |
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 |
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.
ggplot2 plot object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.