CLIQUE
, P3C
, ProClus
,
SubClu
and FIRES
can be applied to data.frames and matrices and will
return S3 objects representing clusterings. For example, using the built-in
demo dataset, you can do:>data("subspace_dataset")
>clustering <-
P3C(subspace_dataset,PoissonThreshold=2)
>clustering
Subspace clustering generated by the package Subspace, containing 12
clusters.
These subspace_clustering objects are actually just lists of subspace_cluster objects, which can be accessed as follows.
>clustering[[1]]
Subspace cluster generated by the package
Subspace. This cluster consists of 140 objects in a 3 dimensional subspace.
Each of these clusters then holds a vector representing its subspace and a
vector with the indexes of the objects the belong in this cluster. In this
example, these could be accessed as clustering[[1]]$objects
and
clustering[[1]]$subspace
.
This package also provides a plot
method for
subspace_clustering objects:
>plot(clustering,subspace_dataset)
Showing dynamic
visualisation. Press Escape/Ctrl + C to stop.
These plots are created using the ggvis
package.
Finally, you can save clusterings to a file using the
clustering_from_file
and clustering_to_file
functions.
For example you could save the clustering from this example to a file and load the true clustering of the demo dataset:
>clustering_to_file(clustering,file_path="clustering.txt")
>path_to_clustering <- paste(path.package("subspace"),"/extdata/subspace_dataset.true",sep="")
true_clustering <- clustering_from_file(file_path=path_to_clustering)