当前位置: 动力学知识库 > 问答 > 编程问答 >

In R, how do I check a vector for values and then increment a different variable n for every value present?

问题描述:

I am new to R! I would like to know how to check a vector for values greater than 1.96 and then increment a variable n by 1 for every value greater than 1.96. I know an example in C++ for an array

for(i<101)

{

if(samplespace[i]>1.96)

n=n+1;

}

Now I just need to know how to do the same thing with a vector in R. Any help would be much appreciated!

分享给朋友:
您可能感兴趣的文章:
随机阅读: