R/ellipsoid_cluster_plot_3d.R
ellipsoid_cluster_plot_3d.Rd
Plot cluster data in 3D by modeling them as an Ellipsoid.
ellipsoid_cluster_plot_3d( niche_data, cluster_ids, x, y, z, mve = FALSE, ellips = TRUE, level = 0.975, alpha, grupos, vgrupo, cex1 = 0.25 )
niche_data | A data.frame or matrix containing niche variables |
---|---|
cluster_ids | Cluster ids |
x | variable on x-axes |
y | variable on y-axes |
z | variable on z-axes |
mve | A logical value. If TRUE a minimum volume ellipsoid will be computed using
the function |
ellips | Ellipsoid plot of each cluster |
level | proportion of points inside the ellipsoid. |
alpha | Transparency level of ellipsoid plots |
grupos | Logical. Show ids of a geographic grouping variable |
vgrupo | A vector containing the levels of the geographic grouping variable |
cex1 | Point size |
Returns a list of the ellipsoid metadata for each cluster.
The output of this function is the same of the cov_center
function.
if (FALSE) { cluster_data <- read.csv(system.file("extdata", "nichekmeansCluster.csv", package = "ntbox")) ellipsoid_clusters <- ellipsoid_cluster_plot_3d(niche_data =environ_data[,c("bio5","bio6","bio12")], cluster_ids = cluster_data$cluster, x = "bio5",y="bio6",z="bio12",mve = T, ellips = T,alpha = 0.25, grupos = T,vgrupo =cluster_data$cluster, cex1 = 1,level = 0.975) # Print metadata for the Minimum Volume Ellipsoid that belongs to cluster 1 print(ellipsoid_clusters$cluster_n_1) }