Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

smoothArc

Draw an undirected assocation in a DAG.


Description

This draws a dashed connection between two points, curving it so that it goes through a third point. This is internally used by dag.draw to draw associations.

Usage

smoothArc(A, B, C, res = 20, gap = 0.05, p = FALSE)

Arguments

A

Vector of length 2, providing xy coordinates of first point.

B

Vector of length 2, providing xy coordinates of second point.

C

Vector of length 2, indicating xy coordinates through which the association should be curved.

res

How smooth should the curve be drawn?

gap

How far from point A and B should the line end?

p

If TRUE, the point through which the curve goes is drawn (this is to allow better moving it with dag.move).

Note

In the version 1.0.1 distributed as online supplemental material with Breitling (2010), the function contains arbitrary default values used during development.

Author(s)

Lutz P Breitling <l.breitling@posteo.de>

References

Breitling LP (2010). dagR: a suite of R functions for directed acyclic graphs. Epidemiology 21(4):586-587.

See Also

Examples

dag.draw(demo.dag1());
smoothArc(c(0.5,0.5), c(1,1), c(0.75,0.6), p=TRUE);
smoothArc(c(0.5,0.5), c(1,1), c(0.65,0.6), p=TRUE);
smoothArc(c(0.5,0.5), c(1,1), c(0.55,0.6), p=TRUE);
smoothArc(c(0.5,0.5), c(1,1), c(0.45,0.6), p=TRUE);

dagR

R Functions for Directed Acyclic Graphs

v1.2.0
GPL-2
Authors
Lutz P Breitling
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.