ggconsort
ggconsort copied to clipboard
Make the arrow argument order consistent in the example
Thank you for the much needed package and the great talk at R/Med. I am adding {ggconsort
} into my workflows (and what I teach). The argument list when you show arrows in the documentation is not consistent. While it is perfectly fine for R, it made me go ... errr .... wait... what... when I was making my first diagram. Sometimes you have end arguments/details first and other times you have start arguments/details first.
consort_arrow_add(
end = "exclusions", end_side = "left" start_x = 0, start_y = 40
) %>%
consort_arrow_add(
"full", "bottom", "randomized", "top"
%>%
consort_arrow_add(
start_x = 0, start_y = 30, end_x = 0, end_y = 20,
%>%
consort_line_add(
start_x =-30, start_y = 20, end_x = 30, end_y = 20,
%>%
consort_arrow_add(
end = "arm_a", end_side = "top" start_x =-30, start_y = 20
%>%
consort_arrow_add(
end = "arm_b", end_side = "top", start_x = 30 , start_y = 20
)
Making them consistent, with the start of arrow arguments before the end arguments, would help. I am not sure what the tidyverse style guide would say about putting the arrow start arguments on one line and the end of arrow arguments on another but I find this easy to read:
consort_arrow_add(
start_x = 0, start_y = 40,
end = "exclusions", end_side = "left"
) %>%
consort_arrow_add(
"full", "bottom",
"randomized", "top"
) %>%
consort_arrow_add(
start_x = 0, start_y = 30,
end_x = 0, end_y = 20
) %>%
consort_line_add(
start_x =-30, start_y = 20,
end_x = 30, end_y = 20
) %>%
consort_arrow_add(
start_x =-30, start_y = 20,
end = "arm_a", end_side = "top"
) %>%
consort_arrow_add(
start_x = 30 , start_y = 20,
end = "arm_b", end_side = "top"
)
Again, thank you. You made my job easier!
This is an excellent suggestion, thank you!! I'll incorporate in the next round of changes.