gauge: Gauge Grid

Description Usage Arguments Types Examples

View source: R/scale.R

Description

Gauge the variables (aspects) used to define axis and grid of the plot.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
gauge(
  g,
  asp,
  ...,
  nice = TRUE,
  range = NULL,
  min = NULL,
  max = NULL,
  min_limit = NULL,
  max_limit = NULL,
  alias = NULL,
  tick_count = NULL,
  max_tick_count = NULL
)

gauge_x_time(g, ..., show_last = FALSE)

gauge_y_time(g, ..., show_last = FALSE)

gauge_x_linear(g, ..., tick_interval = NULL)

gauge_y_linear(g, ..., tick_interval = NULL)

gauge_x_cat(g, ...)

gauge_y_cat(g, ...)

gauge_x_time_cat(g, ...)

gauge_y_time_cat(g, ...)

gauge_x_log(g, ..., base = 10)

gauge_y_log(g, ..., base = 10)

gauge_x_pow(g, ...)

gauge_y_pow(g, ...)

gauge_x_quantile(g, ...)

gauge_y_quantile(g, ...)

gauge_x_quantize(g, ...)

gauge_y_quantize(g, ...)

gauge_x_identity(g, ...)

gauge_y_identity(g, ...)

gauge_asp(g, ...)

Arguments

g

An object of class g2r or g2Proxy as returned by g2() or g2_proxy().

asp

Bare column name of aspect to apply the gauge to.

...

Options to gauge variables (aspects defined by asp()).

nice

Automatically adjust min, and max.

range

A vector of length 2 giving the minimum, and maximum.

min, max

Range of the gauge.

min_limit, max_limit

Strict range of the ticks.

alias

Alias name of the gauge and variable to display.

tick_count

Maximum number of ticks.

max_tick_count

Maximum number of ticks.

show_last

Whether to force show the last tick (only for time gauges).

tick_interval

Minimum tick interval, only applies to linear type of gauge.

base

Base of log.

Types

Examples

1
2
3
4
5
6
g <- g2(cars, asp(speed, dist)) %>%
  fig_point()

g %>% gauge(speed, min = 0)
g %>% gauge_y_log(title = "Log")
g %>% gauge(dist, tickCount = 10)

devOpifex/g2r documentation built on Jan. 16, 2022, 12:36 a.m.