fkelly6 = matrix(data = NA, nrow = 252, 3)
for(i in 1:252){
fkelly6[i,] = matrix(c(ftmp6[i,],1-sum(ftmp6[i,])),1,3)
if(fkelly6[i,]>= 15){
fkelly6[i,]<-15
}
}
我想检查所有f是否都大于等于15,并用15代替。 该代码有效,但它给了我几条警告:“如果((fkelly6 [i,]> = 15){...: 条件的长度> 1,并且只会使用第一个元素” 他们是什么意思? 谢谢
答案 0 :(得分:0)
这是您无需循环即可更改某些值的方法:
<div id="controlContainer">
<h1>Main Container</h1>
</div>
<div id="beforeUpload" style="display: none;">
<h2>It will append to "Main Container" and this is Before Upload</h2>
</div>
<div id="uploadHeading" style="display: none;">
<h4>It will prepend to "Main Container" and this is Upload Heading</h4>
</div>
<div id="afterUpload" style="display: none;">
<h3>It will append to "Main Container" and this is After Upload</h3>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>