Calling R in java-Rcaller

扶醉桌前 提交于 2019-12-02 02:04:35

You have some spelling mistakes in you code. like clValid not clvalid , and you miss many quotes like "hierarchical",....

I think it is better to put your code in a script, and call it from java like this :

Runtime.getRuntime().exec("Rscript myScript.R"); 

where myScript.R is :

library(clValid)
data(mouse)
express <- mouse [,c('M1','M2','M3','NC1','NC2','NC3')]
rownames (express) <- mouse$ID 
intern <- clValid(express, 2:6 , clMethods = c( 'hierarchical','kmeans',
                                               'diana','clara','model') ,
                                                validation = 'internal')
b <- summary(intern) 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!