2016-05-10 38 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)