draw_twoway_contrast | R Documentation |
Draw two one-way contrasts using block arrows, showing a two-way connector
draw_twoway_contrast(
x0,
x1,
y0,
y1,
color = "peachpuff",
border = "black",
extend_ex = 0.3,
extend_angle = 10,
plot_type = c("base", "grid"),
label = NULL,
label_sep = "\n",
na.rm = TRUE,
label_color = "white",
label_cex = 1,
label_font = 2,
oneway_position = 0.5,
twoway_label = NULL,
twoway_label_color = label_color,
twoway_label_cex = label_cex,
twoway_label_font = label_font,
twoway_position = 0.5,
twoway_lwd = 5,
contingency = c(none = "none", half = "scrunch", full = "loop"),
draw_oneway = TRUE,
drawing_order = c("two-two-one", "one-two", "two-one-two"),
do_plot = TRUE,
verbose = FALSE,
...
)
x0 , x1 , y0 , y1 |
|
color , border |
|
extend_ex |
|
extend_angle |
|
plot_type |
|
label |
|
label_sep |
|
na.rm |
|
label_color |
|
label_cex |
|
label_font |
|
twoway_label |
|
twoway_label_color |
|
twoway_label_cex |
|
twoway_label_font |
|
twoway_position |
|
twoway_lwd |
|
contingency |
The value is used to define a contingency plan for each scenario above:
|
draw_oneway |
|
drawing_order |
|
do_plot |
|
verbose |
|
... |
additional arguments are passed to |
This function essentially draws two one-way contrasts
in the form: (group1-group2)-(group3-group4)
This two-way contrast is represented by two one-way contrasts:
group1-group2
group3-group4
This function renders two individual one-way contrasts, then draws a connector from the end of group2, to the beginning of group3.
Change the order of drawing:
Draw the two-way connector border.
Draw the one-way contrasts.
Draw the two-way connector fill.
These steps would ensure the connector line does not overlap the one-way contrasts, and would allow the connector to connect directly to the contrast at the ends of the block arrows.
Other jam experiment design:
check_sedesign()
,
contrast2comp()
,
contrast_colors_by_group()
,
contrast_names_to_sedesign()
,
contrasts_to_factors()
,
contrasts_to_venn_setlists()
,
draw_oneway_contrast()
,
filter_contrast_names()
,
groups_to_sedesign()
,
plot_sedesign()
,
sedesign_to_factors()
,
validate_sedesign()
plot(NULL, xlim=c(0, 5), ylim=c(0, 4), asp=1, xlab="", ylab="")
draw_twoway_contrast(c(1, 1), c(4, 4), c(1, 2), c(1, 2),
label=c("contrast one", "contrast two"))
plot(NULL, xlim=c(0, 5), ylim=c(0, 4), asp=1, xlab="", ylab="")
draw_twoway_contrast(c(1, 1), c(4, 4), c(1, 2), c(1, 2),
contingency=c("loop"),
label=c("contrast one", "contrast two"))
plot(NULL, xlim=c(0, 5), ylim=c(0, 6), asp=1, xlab="", ylab="")
draw_twoway_contrast(c(1, 2, 1, 2, 2, 2), c(4, 5, 4, 5, 5, 5),
c(1, 1.3, 2, 3, 4, 5), c(1, 1.3, 2, 3, 4, 5),
label=c("contrast one", "contrast two"),
extend_ex=0.5, extend_angle=10, color=colorjam::rainbowJam(6))
plot(NULL, xlim=c(0, 5), ylim=c(0, 6), asp=1, xlab="", ylab="")
draw_twoway_contrast(c(1, 2, 1, 2, 2, 2), c(4, 5, 4, 5, 5, 5),
c(1, 1.3, 2, 2.2, 4, 5), c(1, 1.3, 2, 2.2, 4, 5),
label=c("contrast one", "contrast two"),
extend_ex=0.3, extend_angle=20, color=colorjam::rainbowJam(6))
plot(NULL, xlim=c(-2, 8), ylim=c(1, 6), asp=1, xlab="", ylab="")
draw_twoway_contrast(
x0=c(1, 2, 1, 2, 1, 1, 0, -2, 4, 3, 2, 4),
x1=c(4, 5, 4, 5, 6, 6, 0, -2, 7, 6, 2, 4),
y0=c(1, 1.3, 2, 2.2, 4, 5, 5, 5, 3.2, 3, 6, 6),
y1=c(1, 1.3, 2, 2.2, 4, 5, 3, 3, 3.2, 3, 3.5, 3.5),
label=c("contrast one", "contrast two"), verbose=TRUE,
extend_ex=0.5, extend_angle=10,
color=colorjam::rainbowJam(12, Crange=c(90, 120)))
draw_twoway_contrast(x0=c(4, 3), x1=c(4, 3), y0=c(2, 2), y1=c(1, 1),
label=c("contrast one", "contrast two"),
color=c("gold", "dodgerblue"), extend_angle=-20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.