lkp_2d_tile: 2D Heatmap

View source: R/plots.R

lkp_2d_tileR Documentation

2D Heatmap

Description

Plot a heatmap of the 2 dimensional dataset by first converting the numerical variable of interest into factor using the empirical quantiles

Usage

lkp_2d_tile(
  df,
  x,
  y,
  fill,
  f1,
  f2,
  breaks_fill,
  names_breaks_fill,
  n_breaks_fill = 12,
  label_fill = lab_numb,
  accuracy_fill = NULL,
  show_numbers,
  label_text = lab_numb,
  accuracy_text = NULL,
  divergent = FALSE,
  label_x,
  label_y,
  accuracy_x = NULL,
  accuracy_y = NULL,
  n_breaks_x = NULL,
  n_breaks_y = NULL,
  facet_type = "wrap",
  scales = "fixed",
  labeller = label_verbose,
  nrow = NULL,
  ncol = NULL,
  ...
)

Arguments

df

A data.frame containing the data to represent

x

First dimension

y

Second dimension

fill

Variable of interest

f1

First optional variable for facet display

f2

Second optional variable for facet display

breaks_fill

Breaks to use for the variable of interest. Optional

names_breaks_fill

Names of breaks to use for the variable of interest. Optional

n_breaks_fill

Number of breaks to use for the variable of interest.

label_fill

Labeller to use for the variable of interest

accuracy_fill

Accuracy to use in the display of the variable of interest

show_numbers

Should numbers be printed on top of the bars ? Optional

label_text

Labeller for the printed numbers. Optional

accuracy_text

Accuracy for the printed numbers. Optional

divergent

Should a divergent color palette be used ?

label_x

Labeller for the x axis. Optional

label_y

Labeller for the y axis. Optional

accuracy_x

Accuracy for the y axis. Optional

accuracy_y

Accuracy for the y axis. Optional

n_breaks_x

Desired number of breaks for the x axis. Optional

n_breaks_y

Desired number of breaks for the y axis. Optional

facet_type

Should facet_wrap or facet_grid be used for facetting ?

scales

Should scales be fixed ("fixed", the default), free ("free"), or free in one dimension ("free_x", "free_y")?

labeller

A function that takes one data frame of labels and returns a list or data frame of character vectors. Each input column corresponds to one factor. Thus there will be more than one with vars(cyl, am). Each output column gets displayed as one separate line in the strip label. This function should inherit from the "labeller" S3 class for compatibility with labeller(). You can use different labeling functions for different kind of labels, for example use label_parsed() for formatting facet labels. label_value() is used by default, check it for more details and pointers to other options.

nrow, ncol

Number of rows and columns.

...

Additional parameters to be passed to ll_tile

Value

A ggplot object representing an histogram with one or several facets.


GuillaumeBiessy/Linkplots documentation built on Sept. 11, 2023, 8:37 a.m.