r - R 中与我的代码不匹配的意外符号错误
问题描述
我在 R-studio 中编码,并有一个名为saveResults()
. 它需要:
sce
- 单细胞实验对象。opt
- 包含五件事的清单clusterLabels
- 具有两列的简单数据框
重要的是我收到一条错误消息:
Error: unexpected symbol in:
"saveResults(sce = sce, opt = opt, clusteInputs()
zhengMix"
这与我传递给函数的参数完全不同。您可以在下面代码块的最后一行看到这一点:我传入了正确的参数,但我收到一个错误,说我已经传入clusteInputs()
,而zhengMix
不是clusterLabels
. 我没有一个名为 的函数clusteInputs()
,并且zhengMix
在上面几行。
# Save the clustering data
InstallAndLoadPackagesForSC3Clustering()
opt <- GetOptionInputs()
zhengMix <- FetchzhengMix(opt)
sce <- CreateSingleCellExperiment(zhengMix)
clusterLabels <- getClusterLabels(sce)
opt <- createNewDirectoriesToSaveData(opt)
saveResults <- function(sce, opt, clusterLabels){
print("Beginning process of saving results...")
maxClusters = ncol(clusterLabels)/2+1
for (n in 2:maxClusters){
savePCAasPDF(sce, opt, numOfClusters = n, clusterLabels)
saveClusterLabelsAsRDS(clusterLabels, numOfClusters = n, opt)
}
saveSilhouetteScores(sce, opt)
print("Done.")
}
saveResults(sce = sce, opt = opt, clusterLabels = clusterLabels)
有谁知道发生了什么?我很坚持这一点。
解决方案
这不是最好的解决方案,但我通过从函数中删除代码并在那里运行它来解决我自己的问题,没有引起任何问题。
推荐阅读
- python - 如何将现有对象放入共享内存?
- php - 如何在 PHP json_encode 中转义撇号
- postgresql - 在 PostgreSQL 中反透视数据
- java - Maven:读取程序集时出错:未找到程序集描述符
- javascript - 用(引导)模式的一个替换主滚动条
- sabre - 有没有办法从军刀队列中提取所有信息?
- openstreetmap - 如何查询比 x 长或短的桥?
- bash - 我可以在列有换行符的 bash 中使用“列”吗?
- c++ - 成员函数指针模板替换失败
- java - 如何在 Mongodb/Java 中的 sortByCount 操作后返回所有字段而不仅仅是 id 和 count?