repeat - 循环中断时间
问题描述
我正在使用 Kim Tsao ( http://www.kimtsao.com/Kim_Tsao/Code/Entries/2011/9/30_Reflections_on_the_lake_files/tRFLP_id.r ) 发布的代码进行片段分析。我正在尝试将最后的代码块写入循环,而不是手动运行每个示例的代码。但是,在打印“样本列表结束”后,我无法让循环正确中断
x <- 0
repeat {
x <- x+1
if (x<= length(samplelist)){
samplelist[x]
output = matchSample(x, weightby=c("Height","AreaInPoint"),threshold=4)
if (nrow(output)>1){graphOutput(output)} else {print(samplelist[x]);print(output)}
} else { print("End of sample list.")}
if (print("End of sample list.")){
break
}
解决方案
推荐阅读
- android - 使用 hashmap 将数据插入 firebase
- javascript - 我想通过ajax请求获取Excel文件中的数据
- server - 服务器做什么?
- path - Prolog 未加权图距离减少 1
- angular - 什么是 ReactJS 中的同构渲染方式
- android - 上下文更改时,Android Spotify Remote SDK 播放器状态订阅被调用 3 次
- java - 如何为具有多个模型属性的控制器编写单元测试
- java - 在java中拆分解析文本文件
- javascript - 考虑到用户在编写 JS 时自己将元素添加到 HTML 中?
- docker - 安装作曲家时 Docker 返回非零代码:28