Learn R Programming

dynplot (version 1.1.2)

plot_topology: Plot the topology of a trajectory

Description

Plot the topology of a trajectory

Usage

plot_topology(
  trajectory,
  color_milestones = c("auto", "given", "cubeHelix", "Set3", "rainbow"),
  milestones = NULL,
  layout = NULL,
  arrow = grid::arrow(type = "closed", length = unit(0.4, "cm"))
)

Arguments

trajectory

A dynwrap trajectory.

color_milestones

Which palette to use for colouring the milestones

  • auto: Determine colours automatically. If color is already specified in milestones tibble, this will be used. Otherwise, the colour scheme is determined by milestone_palette_list$auto.

  • given: The milestones object already contains a column color.

  • cubeHelix: Use the rje::cubeHelix() palette.

  • Set3: Use the RColorBrewer::brewer.pal(name = "Set3") palette.

  • rainbow: Use the grDevices::rainbow() palette.

milestones

Tibble containing the column milestone_id (character). If color_milestones is set to "given", this tibble should also contain a column color (character), containing colour hex codes (e.g. "#123456").

layout

The type of layout to create. See ggraph::ggraph() for more info.

arrow

The type and size of arrow in case of directed trajectories. Set to NULL to remove arrow altogether.

Value

A topology ggplot of a trajectory.

Examples

Run this code
# NOT RUN {
data(example_disconnected)
plot_topology(example_disconnected)

data(example_tree)
plot_topology(example_tree)
# }

Run the code above in your browser using DataLab