plotDot: Plot DOT diagram

View source: R/plot.R

plotDotR Documentation

Plot DOT diagram

Description

This function is useful for quickly checking if your spatial.txt file is properly set up. The spatial.txt file can be imported using readDot()

Usage

plotDot(
  dot,
  spatial,
  coord.x,
  coord.y,
  placement = c("literal", "spaced"),
  expand = 1,
  file,
  fill = c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7"),
  text_colour = "white"
)

Arguments

dot

a dot data frame, or a string of text that can be converted to a dot data frame using readDot().

spatial

a data frame containing stations and respective coordinates. Note: The mean coordinates for the stations of any given array will be used.

coord.x, coord.y

The names of the columns containing the x and y positions of the stations in the spatial data frame.

placement

Two possible options: "literal" will place the nodes exactly at the average coordinates for the array (which may lead to varying degrees of overlap). "spaced" will adjust the position of the arrays so every node is fully visible, but the distances between arrays are no longer respected. Only relevant if used in combination with the spatial argument.

expand

A value to increase or decrease spacing between arrays. Ignored if spatial is not provided.

file

Optional: A file name to export the plot. Must include the file extension (one of png, pdf, or svg). E.g. "output.svg"

fill

A vector of colours to use. If spatial is provided and it contains a "Section" column, ach section is assigned a colour. If not enough colours are provided, the argument is ignored and a colour ramp is used.

text_colour

The colour for the array names. Defaults to "white".

Value

No return value, called to either plot or save graphic.

Examples

# create dummy dot string
x <- c(
"A--B--C--D--E--F
A--G--H--I--E
H--C")

my_dot <- readDot(string = x)

# now we can plot it using plotDot:
plotDot(my_dot)

# plotDot can also be called directly using the string of text:
plotDot(x)


hugomflavio/actel documentation built on Dec. 16, 2024, 1:16 p.m.