0

I am unable to retrieve number of microclusters from Clustree. Following is the code:

library(streamMOA)
data <- read.csv("data.csv", sep = ",", header = TRUE)
stream <- DSD_Memory(data)
clustree <- DSC_ClusTree(maxHeight = 3)
reset_stream(stream)
update(clustree, stream, 200)

Now if print clustree object, I get:

print(clustree)

ClusTree
Class: DSC_ClusTree, DSC_Micro, DSC_MOA, DSC 
Number of micro-clusters: 20 

However, clustree&description, clustree$options or clustree&javaObj don't give number of micro clusters. Any help?

Annie
  • 681
  • 7
  • 14
  • One way to do is to capture the output of print and process the string: str <- capture.output(print(clustree)) mic_clus <- as.numeric(unlist(strsplit(str[3], split=' ', fixed=TRUE))[4]) – Annie May 10 '16 at 16:12

1 Answers1

0

a_greater_than_five <- ifelse(a > 5, TRUE, FALSE)

Annie
  • 681
  • 7
  • 14