bivarmap_colmatrix: Creates color matrix for bivariate map plots

Description Usage Arguments Value Examples

View source: R/bivarmap_colmatrix.R

Description

This function creates the matrix of colors to be used in bivariate maps plots. It created a matrix with nbreaks x nbreaks colors do be used to represent a gradient in two different continuous variables.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bivarmap_colmatrix(
  nbreaks = 3,
  breakstyle = "quantile",
  upperleft = "#0096EB",
  upperright = "#820050",
  bottomleft = "#BEBEBE",
  bottomright = "#FFE60F",
  xlab = "x label",
  ylab = "y label",
  plotLeg = TRUE,
  saveLeg = FALSE
)

Arguments

nbreaks

[numeric(1)=3]
Number of breaks for each dimension of the matrix.

breakstyle

[character(1)="quantile"]
Option to break each dimension of the matrix in class intervals to set the colors. It can assume any of the following values: "fixed", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", "jenks", "dpih" or "headtails". (not sd???) For more information, see classInt::classIntervals().

upperleft, upperright, bottomleft, bottomright

[character(1)]
Colors to be assigned to the upperleft, upperright, bottomleft, and bottomright corners of the color matrix. It can be a string with the name of a color or a hexadecimal values representing the color.

xlab, ylab

[character(1)]
Label for the color matrix plot axes, x and y.

plotLeg

[logical(1)=TRUE]
If TRUE, a preview of the legend is plotted.

saveLeg

[logical(1)=TRUE]
Should the legend be saved in an external file? Default is FALSE.

Value

Matrix of colors to be used in bivariate map plots.

Examples

1
2
3
4
data("temprec")

colmatrix <- bivarmap::bivarmap_colmatrix(nbreaks = 9)
colmatrix

mauriciovancine/bivarmap documentation built on Feb. 21, 2022, 5:31 p.m.