Description Usage Arguments Details Alignment
View source: R/geom_river_label.R
Text
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)
|
parse |
If TRUE, the labels will be parsed into expressions and
displayed as described in |
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 |
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 |
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 |
sg_length |
Savitzky-Golay smoothing filter length. Must be odd. See |
check_length |
if TRUE (default) the label is pletted only if there is enough space. |
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).
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.