marker: Custom marker for heatmap plot

View source: R/marker.R

markerR Documentation

Custom marker for heatmap plot

Description

This set of functions makes it easy to define shapes, and it similar to points.

Usage

marker(x, ...)

## S3 method for class 'grob'
marker(
  x,
  width = 1,
  height = 1,
  width_unit = "cm",
  height_unit = width_unit,
  ...
)

## S3 method for class 'gList'
marker(
  x,
  width = 1,
  height = 1,
  width_unit = "cm",
  height_unit = width_unit,
  ...
)

## S3 method for class 'ggplot'
marker(
  x,
  width = 1,
  height = 1,
  width_unit = "cm",
  height_unit = width_unit,
  ...
)

## S3 method for class 'raster'
marker(
  x,
  width = 1,
  height = 1,
  width_unit = "cm",
  height_unit = width_unit,
  ...
)

## S3 method for class ''magick-image''
marker(
  x,
  width = 1,
  height = 1,
  width_unit = "cm",
  height_unit = width_unit,
  ...
)

## S3 method for class 'formula'
marker(
  x,
  width = 1,
  height = 1,
  width_unit = "cm",
  height_unit = width_unit,
  ...
)

## S3 method for class 'character'
marker(
  x,
  width = 1,
  height = 1,
  width_unit = "cm",
  height_unit = width_unit,
  r = 0,
  n = 5,
  ratio = 0.618,
  ...
)

## S3 method for class 'list'
marker(
  x,
  width = 1,
  height = 1,
  width_unit = "cm",
  height_unit = width_unit,
  r = 0,
  n = 5,
  ratio = 0.618,
  ...
)

## S3 method for class 'marker'
marker(x, ...)

Arguments

x

any R object can be converted to marker.

  • grob: a grob, gList, gTree object.

  • list: a list of x and y.

  • character: one of "square", "circle", "star", "heart", "ellipse", "cross", "triangle", "triangle2".

...

ignore.

width, height

width or height of marker.

width_unit, height_unit

units of width or height.

r

only be used for ellipse marker.

n, ratio

only be used for star marker.

Value

a marker object.

Author(s)

Hou Yun

Examples

marker("square")
marker(c("square", "circle"))
m <- marker(c("square", "circle", "star", "heart"))
m[1:3]
rep_len(m, 10)
library(grid)
marker(circleGrob())

Hy4m/linkET documentation built on June 30, 2023, 7:39 p.m.