tile_plot: tile_plot

View source: R/tile_plot.R

tile_plotR Documentation

tile_plot

Description

Creates tile plots.

Usage

tile_plot(
  data,
  x,
  y,
  z = c(Count = "1"),
  facet_x = NULL,
  facet_y = NULL,
  size = 11,
  facet_ncol = NULL,
  labels_x = NULL,
  labels_y = NULL,
  labels_z = ez_labels,
  zlim = function(x) c(pmin(0, x[1]), pmax(0, x[2])),
  palette = ez_jet,
  reorder = c("facet_x", "facet_y")
)

Arguments

data

A data.frame.

x

A named character value. Evaluates to a column.

y

A named character value. Evaluates to a column.

z

A named character. Evaluates to a column and is mapped to the fill colour of the tiles.

facet_x

A character value. Evaluates to a column.

facet_y

A character. Evaluates to a column.

size

theme size for use_theme(). Default is 14.

facet_ncol

Option passed to ncol argument in facet_wrap or facet_grid. Default is NULL.

labels_x

label formatting function

labels_y

label formatting function

labels_z

label formatting function

zlim

argument for scale_fill_grandientn(limits = zlim)

palette

Colour function.

reorder

A character vector specifying the group variables to reorder. Default is c("group", "facet_x", "facet_y").

Examples

## Not run: 
library(tsibbledata)
library(dplyr)
nyc_bikes %>%
  mutate(duration = as.numeric(stop_time - start_time)) %>%
  filter(between(duration, 0, 16)) %>%
  tile_plot(c("Hour of Day" = "lubridate::hour(start_time) + 0.5"),
            c("Ride Duration (min)" = "duration - duration %% 2 + 1"))

## End(Not run)

wkostelecki/ezplot documentation built on Feb. 1, 2024, 10:58 p.m.