Description Usage Arguments See Also Examples
View source: R/rgl_group_representation.R
Compute and draw a star (centroid with links) in a rgl device.
1 2 3 4 5 |
x, y, z |
Numeric vectors representing point coordinates. |
color |
The default color to be used in all elements. |
label |
The label placed at the centroid of the distribution. |
centroid_color |
The color of centroid point of the distribution. |
centroid_radius |
Numeric, the radius of the sphere used to
represent the centroid of the distribution ( |
centroid_alpha |
Numeric, the centroids alpha
( |
link_color |
The color of the links connecting centroid and points. |
link_width, link_alpha |
Numeric, the link width and alpha parameters
( |
label_color |
The color of the centroid label. |
label_cex, label_family, label_font, label_adj, label_alpha |
The text
parameters and the alpha of the centroid label ( |
stars_3d
, rgl_init
,
spheres3d
, segments3d
,
texts3d
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
# Use iris data
data("iris")
# get setosa
setosa <- iris[iris$Species == "setosa",]
# Initializes the rgl device
rgl_init(zoom = 0.8)
# add axes and bounding box
rgl_format(setosa$Sepal.Length, setosa$Sepal.Width, setosa$Petal.Length,
axes_titles = c("Sepal length", "Sepal width", "Petal length"),
show_planes = c("XZ", "XY", "YZ"))
# Add data points
points3d(setosa[, 1], setosa[, 2], setosa[, 3], color = "black")
# Add star
star_3d(setosa[, 1], setosa[, 2], setosa[, 3], label = "setosa",
centroid_color = "green", link_color = "red", label_color = "blue")
remove(setosa)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.