## S3 method for class 'progenyClust':
plot(x,data=NULL,k=NULL,errorbar=FALSE,xlab='',ylab='',...)
progenyClust
object.data
is provided, and needs to be a cluster number that was previously investigated in
plot
(...).progenyClust
function, please run the plot function without specifying the input argument data
. The resulting plot visualizes the stability score at each cluster number. This plot can provide an overview of clustering stability, and can facilitate selecting the optimal cluster number.
The plot function can also visualize the clustering results in scatter plots by specifying the input argument data
. Since the goal is to view how the original data is clustered with certain cluster number, data
needs to contain exactly the same number of samples as in the original data that was used to run the progenyClust
function. If data
contains more than two features, a table of scatter plots will be created to show clustering results within each pair of dimensions. data
with more than 20 features/columns will not be accepted, but a subset of data
with selected features can be used in this case. The input argument k
specifies the cluster number at which the clustering result is shown. Note that k
needs to be a cluster number that was previously examined by progenyClust
when generating the progenyClust
object x
. If k
is not provided, the function will use the optimal cluster number determined by the Gap criterion only if method='gap'
, and will use the optimal number determined by the Score criterion if method='gap'
or method='both'
when running progenyClust
.# a 3-cluster 2-dimensional example dataset
data('test')
# default progeny clsutering
progenyClust(test,ncluster=2:5)->pc
# plot the scores to select the optimal cluster number
plot(pc)
# plot the clustering results with the optimal cluster number
plot(pc,test)
Run the code above in your browser using DataLab