2016-05-10 37 views
0

我无法从Clustree获取微集群的数量。以下是代码:从Clustree获取微集群的数量R

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) 

现在,如果打印clustree对象,我得到:

print(clustree) 

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

然而,clustree &描述,clustree $选项或clustree & javaObj不给微群的数量。任何帮助?

+0

一种方式做是捕获打印的输出,并处理该字符串: STR < - capture.output(印刷(clustree)) (unist(strsplit(str [3],split ='',fixed = TRUE))[4]) – Annie

回答

0

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