rotate_coordinates | R Documentation |
Rotate numeric coordinates, optionally after reflecting coordinates along one or more coordinate axes.
rotate_coordinates(
x,
degrees = 0,
reflect = c("none", "x", "y", "z"),
center = NULL,
center_rule = c("median", "origin", "mean", "min", "max"),
rotation_axes = c(1, 2),
verbose = FALSE,
...
)
x |
|
degrees |
numeric value indicating the degrees to rotate layout coordinates, where 360 degrees is one complete rotation. |
reflect |
|
center |
|
center_rule |
|
rotation_axes |
|
... |
additional arguments are ignored. |
This function rotates coordinates in two axes, by the angle
defined in degrees
. It optionally reflects coordinates in
one or more axes, which occurs before rotation.
Note that the reflect
is applied before degrees
.
Rotation code kindly contributed by Don MacQueen to the maptools
package, and is reproduced here to avoid a dependency on maptools
and therefore the sp
package.
numeric matrix
with the same number of columns as the
input x
.
Other jam utility functions:
avg_angles()
,
avg_colors_by_list()
,
call_fn_ellipsis_deprecated()
,
cell_fun_bivariate()
,
collapse_mem_clusters()
,
colorRamp2D()
,
deconcat_df2()
,
display_colorRamp2D()
,
enrichList2geneHitList()
,
filter_mem_genes()
,
filter_mem_sets()
,
find_colname()
,
get_hull_data()
,
get_igraph_layout()
,
gsubs_remove()
,
handle_igraph_param_list()
,
isColorBlank()
,
make_legend_bivariate()
,
make_point_hull()
,
mem_find_overlap()
,
order_colors()
,
rank_mem_clusters()
,
subgraph_jam()
,
subset_mem()
,
summarize_node_spacing()
,
xyAngle()
layout <- cbind(0:10, 0:10);
layout_rot50 <- rotate_coordinates(x=layout, degrees=50);
layout_rot40_ctrmean <- rotate_coordinates(x=layout, degrees=40, center_rule="mean");
layout_reflectx_ctrmean <- rotate_coordinates(x=layout, reflect="x", center_rule="mean");
plot(rbind(layout, layout_rot50, layout_rot40_ctrmean, layout_reflectx_ctrmean),
col=rep(c("darkorchid", "darkorange1", "dodgerblue", "red4"), each=11),
pch=rep(c(17, 20, 18, 17), each=11),
cex=2);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.