Description Usage Arguments Details Value See Also Examples
A wrapper function for graphics::locator
that makes the creation
of rules easier.
1 | place_rule(x_axis, y_axis, line_type = "f")
|
x_axis |
a character string indicating the colour variable that
corresponds to the x axis, one of |
y_axis |
a character string indicating the colour variable that
corresponds to the y axis, one of |
line_type |
a character string indicating that the line is vertical
|
This function calls graphics::locator
allowing to select two
points, plots the line joining these points and returns a list
containing their coordinates. The coordinates are rearranged to
pass them to define_rule()
.
True horizontal and vertical lines are difficult to create by hand. In
these cases, specifying "vertical"
or "horizontal"
(partial
match allowed, i e "h") will copy the appropriate coordinate value from the
first point to the second. Note that this is done after locator()
returns, so the plot will show the line joining the original points, not
the corrected ones. Use plot_rule()
to see corrected line.
A list of class rule_points
containing the following elements:
x_axis
: a character string containing the colour variable
selected as x
axis.
y_axis
: a character string containing the colour variable
selected as y
axis.
first_point
: coordinates of the start point of the line.
second_point
: coordinates of the end point of the line.
locator
, define_rule
,
plot_rule
, plot_rgb_plane
1 2 3 4 5 6 | ## Not run:
plot_rgb_plane("r", "g")
line01 <- place_rule("r", "g") # A "free" line
line02 <- place_rule("r", "g", "h") # A horizontal line
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.