Using an unclustered input data frame (fci), an APResult is created from apcluster() as epxected:
> apclr2q02 <- apcluster(negDistMat(r=2), fci)
> show(apclr2q02)
APResult object
Number of samples = 1045
Number of iterations = 826
Input preference = -22.6498
Sum of similarities = -1603.52
Sum of preferences = -1336.338
Net similarity = -2939.858
Number of clusters = 59
The online documentation says that aggExCluster() can accept either data to be clustered as input, or a previous clustering result (ExClust or APResult). Running aggExCluster on the unclustered data (fci), the code works as expected:
> aglomr2 <- aggExCluster(negDistMat(r=2), fci)
> aglomr2
AggExResult object
Number of samples = 1045
Maximum number of clusters = 1045
The result can be plotted in dendogram format and all is well; however, using the APResult obtained above (apclr2q02) as input, the following error is returned:
> aglomr2 <- aggExCluster(negDistMat(r=2), apclr2q02)
Error in as.vector(data) :
no method for coercing this S4 class to a vector
Any suggestions about what I might be doing wrong with the APResult object as input?