Skip to contents

Parameters to customize titles of roboplots. Can be used with robotables and robomaps, but don't really do anything.

Usage

set_title(
  title = NULL,
  include = getOption("roboplot.title")$include,
  xref = getOption("roboplot.title")$xref,
  ...
)

Arguments

title

Character. Optional. Will try to determine a title based on attributes of d in a roboplots. Defaults to "PLACEHOLDER". Omit by providing "", but for roboplot, you need to provide a color if you don't have a title.

include

Logical. Determines whether the given title will be used in the displayed plot. Will always inlcude it for modebar-exported static images. You should still provide a title even if you don't want it displayed in the plot (see title).

xref

Character. Either "container" or "plot". Determines if the title is anchored to the left plot or the container edge.

...

Placeholder for other parameters.

Value

A list of class roboplotr.set_title

Examples

# Used to set titles for plots created with `roboplot()`. You can
# simply give a charater string for plot titles.

d <- energiantuonti |> dplyr::filter(Alue == "USA",Suunta == "Tuonti")

d |> roboplot(Alue,"Energian tuonti Yhdysvalloista")
# However, if you want to render the plot without the title included, you # can use `set_title(include = F)` to omit it from the plot. This # is for cases where you will insert the plot into environment where the # title is outside the plot element. When exporting, you would still want to # have the title included, and `roboplot()` takes care of this. If you include # a subtitle, it will be displayed regardless. d |> roboplot(Alue, title = set_title("Energian tuonti Yhdysvalloista", include = FALSE), subtitle = "Milj. €")
# Anchor the title to the left edge of the container instead of the plot with # `xref`. You probably want to do the same for caption, but you don't have to. d |> roboplot(Alue, title = set_title("Energian tuonti Yhdysvalloista", xref = "container"), caption = set_caption("Tilastokeskus", xref = "container") )