Description Usage Arguments Details Value Examples
View source: R/plot_blocks_EG.R
Creates a plot representing environmental blocks (all or selected) in both spaces, environmental and/or geographic.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | plot_blocks_EG(master, region_border = TRUE, mask_border = FALSE,
which = "all", block_ID = FALSE, col_all = NULL,
col_selected = NULL, col_ID = NULL, cex_all = 0.7,
cex_selected = 1, cex_ID = 1, pch_all = 16,
pch_selected = 16, add_main = TRUE)
plot_blocks_E(master, which = "all", block_ID = FALSE, col_all = NULL,
col_selected = NULL, col_ID = NULL, cex_all = 0.7,
cex_selected = 1, cex_ID = 1, pch_all = 16,
pch_selected = 16, main = "", xlab = NULL, ylab = NULL)
plot_blocks_G(master, region_border = TRUE, mask_border = FALSE,
which = "all", block_ID = FALSE, col_all = NULL,
col_selected = NULL, col_ID = NULL, cex_all = 0.7,
cex_selected = 1, cex_ID = 1, pch_all = 16, pch_selected = 16)
|
master |
master_matrix object derived from function
|
region_border |
(logical) whether to add region border to the plot. Default = TRUE. |
mask_border |
(logical) whether to add mask border to the plot. Ignored
if mask is not present in |
which |
(character) blocks to be plotted. Options are "all" or "selected". Default = "all". |
block_ID |
(logical) whether to add a text ID to blocks plotted in environmental space. Default = FALSE. |
col_all |
colors for points in all blocks. The default, NULL, uses a
color blind friendly palette to differentiate among distinct blocks when
|
col_selected |
color for points in selected blocks. Ignored if
|
col_ID |
color for text ID to be added if |
cex_all |
(numeric) value defining magnification of points in all blocks relative to the default. Default = 0.7. |
cex_selected |
(numeric) value defining magnification of points in selected blocks relative to the default. Default = 1. |
cex_ID |
(numeric) value defining magnification of text ID to be added
if |
pch_all |
(numeric) integer specifying a symbol when plotting points of all blocks. Default = 16. |
pch_selected |
(numeric) integer specifying a symbol when plotting points of selected blocks. Default = 16. |
add_main |
(logical) whether or not to add fixed titles to the plot. Default = TRUE. Titles added are "Environmental space" and "Geographic space". |
main |
(character) the main title for the plot. |
xlab |
(character) label for the x axis. The default, NULL, uses variable_1. |
ylab |
(character) label for the y axis. The default, NULL, uses variable_2. |
Defining colors in col_all
depends on what is chosen in which
.
If "all" is chosen, it is convenient to define col_all
as a color
ramp palette (randomly arranged) or a set of colors depending on the number
of blocks in the object defined in master
. If "selected" is chosen
in which
it is recommended to use a single color, preferably a light
one, so the selected blocks can be easily identified. See examples.
A plot showing all the blocks of the region of interest and, if asked, the blocks that were selected. They are show in both spaces, geographic and/or environmental.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Data
data("m_matrix", package = "biosurvey")
# Creating blocks
m_blocks <- make_blocks(m_matrix, variable_1 = "PC1",
variable_2 = "PC2", n_cols = 10, n_rows = 10,
block_type = "equal_area")
plot_blocks_EG(master = m_blocks, block_ID = TRUE)
plot_blocks_E(master = m_blocks)
plot_blocks_G(master = m_blocks)
# Defining your own colors
n_blocks <- length(m_blocks$data_matrix$Block)
your_palette <- sample(heat.colors(n_blocks), n_blocks)
block_factor <- as.factor(m_blocks$data_matrix$Block)
your_colors <- your_palette[block_factor]
plot_blocks_EG(master = m_blocks, block_ID = TRUE, col_all = your_colors)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.