plot.fclust | R Documentation |
Plot method for class fclust
. The function creates a scatter plot visualizing the cluster structure. The objects are represented by points in the plot using observed variables or principal components.
## S3 method for class fclust ## S3 method for class 'fclust' plot(x, v1v2, colclus, umin, ucex, pca, ...)
x |
Object of class |
v1v2 |
Vector with two elements specifying the numbers of the variables (or of the principal components) to be plotted (default: |
colclus |
Vector specifying the color palette for the clusters (default: |
umin |
Lowest maximal membership degree such that an object is assigned to a cluster (default: 0) |
ucex |
Logical value specifying if the points are magnified according to the maximal membership degree (if |
pca |
Logical value specifying if the objects are represented using principal components (if |
... |
Additional arguments arguments for |
In the scatter plot the objects are represented by circles (pch=16
) and the prototypes by stars (pch=8
) using observed variables (if pca=FALSE
) or principal components (if pca=TRUE
), the numbers of which are specified in v1v2
. Their colors differ for every cluster according to colclus
. Objects such that their maximal membership degrees are lower than umin
are in black. The sizes of the circles depends on the maximal membership degrees of the corresponding objects if ucex=TRUE
. Also note that principal components are extracted using standardized data.
In case of relational data, the first two components resulting from Non-metric Multidimensional Scaling performed using the package MASS are used.
Paolo Giordani, Maria Brigida Ferraro, Alessio Serafini
VIFCR
, VAT
, VCV
, VCV2
, Fclust
, print.fclust
, summary.fclust
, Mc
## McDonald's data data(Mc) names(Mc) ## data normalization by dividing the nutrition facts by the Serving Size (column 1) for (j in 2:(ncol(Mc)-1)) Mc[,j]=Mc[,j]/Mc[,1] ## removing the column Serving Size Mc=Mc[,-1] ## fuzzy k-means ## (excluded the factor column Type (last column)) clust=FKM(Mc[,1:(ncol(Mc)-1)],k=6,m=1.5,stand=1) ## Scatter plot of Calories vs Cholesterol (mg) names(Mc) plot(clust,v1v2=c(1,5)) ## Scatter plot of Calories vs Cholesterol (mg) using gray levels for the clusters plot(clust,v1v2=c(1,5),colclus=gray.colors(6)) ## Scatter plot of Calories vs Cholesterol (mg) ## coloring in black objects with maximal membership degree lower than 0.5 plot(clust,v1v2=c(1,5),umin=0.5) ## Scatter plot of Calories vs Cholesterol (mg) ## coloring in black objects with maximal membership degree lower than 0.5 ## and magnifying the points according to the maximal membership degree plot(clust,v1v2=c(1,5),umin=0.5,ucex=TRUE) ## Scatter plot using the first two principal components and ## coloring in black objects with maximal membership degree lower than 0.3 plot(clust,v1v2=1:2,umin=0.3,pca=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.