Description Usage Arguments Details Value Author(s) Examples
Converts text postion from clock digits to vector (horizontal, vertical, direction). It was inspired by Stata, and will be useful when applying recharts functions.
1 2 3 |
pos |
integer 0-25, clock digits. |
drop |
logical, whether coerce the result to vector when |
unname |
logical, whether unname the result. Default TRUE. |
... |
other arguments |
The function is designed to map clock digits to the 3*3 grids of the lyaout. The corresponding position vectors (horizontal, vertical, direction) to the clock integers are as follows.
the favorable position definitions on the clock
11(l, t, h) | 12(c, t, h) | 1(r, t, h) | ||
10(l, t, v) | 2(r, t, v) | |||
9(l, c, v) | 0(c, c, h) | 3(r, c, v) | ||
8(l, b, v) | 4(r, b, v) | |||
7(l, b, h) | 6(c, b, h) | 5(r, b, h) |
the same position as 0-12, with the direction reverted
23(l, t, v) | 24(c, t, v) | 13(r, t, v) | ||
22(l, t, h) | 14(r, t, h) | |||
21(l, c, h) | 25(c, c, v) | 15(r, c, h) | ||
20(l, b, h) | 16(r, b, h) | |||
19(l, b, v) | 18(c, b, v) | 17(r, b, v) |
To make it more intuitive, please check the charts below:
Note: "=" refers to horizontal direction, "||" refers to vertical direction.
A vector or 3-column matrix of horizontal
(x-alignment), vertical
(y-alignment) and direction
(direction).
Yiying Wang, wangy@aetna.com
1 2 3 4 5 6 7 8 9 | ## Not run:
convClock2Pos(2) ## returns c("right", "top", "vertical")
clock_to_pos(2:3, unname=FALSE) # returns
# horizontal vertical direction
# 2 "right" "top" "vertical"
# 3 "right" "center" "vertical"
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.