Nodes | R Documentation |
geom_dag_node
and geom_dag_point
are very similar to
ggplot2::geom_point but with a few defaults changed. geom_dag_node
is
slightly stylized and includes an internal white circle, while
geom_dag_point
plots a single point.
geom_dag_node(
mapping = NULL,
data = NULL,
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_dag_point(
mapping = NULL,
data = NULL,
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
... |
Other arguments passed on to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
geom_dag_node
and geom_dag_point
understand the
following aesthetics (required aesthetics are in bold):
x
y
alpha
colour
fill
shape
size
stroke
filter
geom_dag_node
also accepts:
internal_colour
library(ggplot2)
g <- dagify(m ~ x + y, y ~ x)
p <- g %>%
tidy_dagitty() %>%
ggplot(aes(x = x, y = y, xend = xend, yend = yend)) +
geom_dag_edges() +
theme_dag()
p +
geom_dag_node() +
geom_dag_text()
p +
geom_dag_point() +
geom_dag_text()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.