Help!!!同一数据用ClusterData()method选择C-Means可以跑,选择K-Means报错。
class(exps) [1] "matrix" "array"
3.3 kmeans for clustering ----
km <- clusterData(obj = exps, scaleData = TRUE, cluster.method = "kmeans", cluster.num = 6, seed = 123) 错误于if (class(eset) %in% c("data.frame", "matrix")) {: the condition has length > 1 这里数据结构没有问题,但是报错了。
3.2 mfuzz for clustering ----
cm <- clusterData(obj = exps, scaleData = TRUE, seed = 123, cluster.method = "mfuzz", cluster.num = 6) [1] "0 genes excluded.\n" 选择mfuzz则不报错
重新安装试试
重新安装试试 很奇怪,Kmeans依旧报错而Cmeans方法正常 pak::pak("junjunlab/ClusterGVis") library(ClusterGVis)
3.3 kmeans for clustering ----
km <- clusterData(obj = exps, scaleData = TRUE, cluster.method = "kmeans", cluster.num = 6, seed = 123) 错误于if (class(eset) %in% c("data.frame", "matrix")) {: the condition has length > 1
因为依赖改了,kmeans方法下会调用filter.std函数来进行过滤,但是过滤要求数据必须是ExpressionSet形式。之后的kmeans又需要数据位matrix格式。
转换成数据框 mat_df <- as.data.frame(mat)
感谢回复!这个之前试过啦,但依旧报错。
---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2025年06月04日 13:16 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [junjunlab/ClusterGVis] Help!!!同一数据用ClusterData()method选择C-Means可以跑,选择K-Means报错。 (Issue #122) | SeanTylerxwg left a comment (junjunlab/ClusterGVis#122)
转换成数据框 mat_df <- as.data.frame(mat)
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
转换成数据框 mat_df <- as.data.frame(mat)
我用这个解决了
嗯嗯,是的
---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2025年11月10日 14:58 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [junjunlab/ClusterGVis] Help!!!同一数据用ClusterData()method选择C-Means可以跑,选择K-Means报错。 (Issue #122) | TDdiu left a comment (junjunlab/ClusterGVis#122)
转换成数据框 mat_df <- as.data.frame(mat)
我用这个解决了
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>