geom_river_label: Text

Description Usage Arguments Details Alignment

View source: R/geom_river_label.R

Description

Text

Usage

1
2
3
4
5
geom_river_label(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", ..., parse = FALSE, nudge_x = 0, nudge_y = 0,
  na.rm = FALSE, centred = TRUE, relative = TRUE, reverse = NA,
  repeated = FALSE, smoothing = TRUE, sg_order = 2, sg_length = 51,
  check_length = TRUE, show.legend = FALSE, inherit.aes = TRUE)

Arguments

parse

If TRUE, the labels will be parsed into expressions and displayed as described in ?plotmath.

nudge_x, nudge_y

Horizontal and vertical adjustment to nudge labels by. Useful for offsetting text from points, particularly on discrete scales.

relative

if TRUE (default) the positioning aes such as offset, dist, wind and vpos is computed relative to the length of the longest path. The last three are relative to the longest path, for consistency reasons.

reverse

if TRUE the label is writen in the opposite direction. By default the direction is defined by the sign of the x coordinates of the begining and end of the path. If the path ends on the left relative to the start, the labeling is reversed.

repeated

if TRUE the label is repeated along the path as often as possible. Each label is separated by a distance of offset.

smoothing

if TRUE(default) smooth the path before computing the letter positioning. Recommended to avoid weird kerning.

sg_order

Savitzky-Golay smoothing filter order. See ?sgolayfilt for more details.

sg_length

Savitzky-Golay smoothing filter length. Must be odd. See ?sgolayfilt for more details.

check_length

if TRUE (default) the label is pletted only if there is enough space.

Details

Because the path of a river can be tortuous, the distances are linear "flight" distances rather than distances following the path. However if relative = TRUE the computed distance are computed relatively to the length of the path group, therefore even a distance lower than 0.5 can place the label at the end of the path. For consistency reason if not repeated == FALSE the offset is relative to the path group length (consistency in the position of the unique labels), else it is relative to the maximum path group length (consistency in the distance between labels).

Alignment

You can modify text alignment with the 'vjust' and 'hjust' aesthetics. These can either be a number between 0 (right/bottom) and 1 (top/left) or a character ('"left"', '"middle"', '"right"', '"bottom"', '"center"', '"top"'). There are two special alignments: '"inward"' and '"outward"'. Inward always aligns text towards the center, and outward aligns it away from the center.


Clement-Viguier/ggriverlab documentation built on Nov. 8, 2019, 10:02 p.m.