title: Argument is of length zero in if statement
body: <p>I am having a little problem with R and I am not sure why. It is telling me that this line: <code>if(temp &gt; data[[k]][[k2]]) {</code> is of argument length 0. Here is the block which is not that big:</p>
  <pre><code>for(k in 1:length(data)) { 
        temp &lt;- 0
        for(k2 in 3:length(data[[k]])) {
             print(data[[k]][[k2]])
             if(temp &gt; data[[k]][[k2]]) {
                  temp &lt;- data[[k]][[k2]]
              }
              fMax[k] &lt;- temp
             k2 &lt;- k2 + 1
        }
   k &lt;- k + 1
   }
  </code></pre>
  <p>example of what is in data[[k]][[k2]]:</p>
  <pre><code>[1] &quot;3050&quot;
  [1] &quot;3051&quot;
  [1] &quot;3054&quot;
  [1] &quot;3054&quot;
  [1] &quot;3052&quot;
  [1] &quot;3053&quot;
  [1] &quot;3059&quot;
  [1] &quot;3059&quot;
  [1] &quot;3057&quot;
  [1] &quot;3060&quot;
  [1] &quot;3063&quot;
  [1] &quot;3060&quot;
  [1] &quot;3068&quot;
  [1] &quot;3067&quot;
  [1] &quot;3079&quot;
  [1] &quot;3085&quot;
  [1] &quot;3094&quot;
  [1] &quot;3107&quot;
  [1] &quot;3121&quot;
  [1] &quot;3135&quot;
  [1] &quot;3147&quot;
  [1] &quot;3161&quot;
  [1] &quot;3200&quot;
  [1] &quot;3237&quot;
  [1] &quot;3264&quot;
  [1] &quot;3274&quot;
  [1] &quot;3284&quot;
  [1] &quot;3289&quot;
  [1] &quot;3292&quot;
  [1] &quot;3300&quot;
  [1] &quot;3301&quot;
  [1] &quot;3303&quot;
  [1] &quot;3306&quot;
  [1] &quot;3310&quot;
  [1] &quot;3312&quot;
  [1] &quot;3313&quot;
  [1] &quot;3319&quot;
  [1] &quot;3314&quot;
  [1] &quot;3318&quot;
  [1] &quot;3318&quot;
  [1] &quot;3320&quot;
  [1] &quot;3322&quot;
  [1] &quot;3322&quot;
  [1] &quot;3322&quot;
  [1] &quot;3328&quot;
  [1] &quot;3332&quot;
  [1] &quot;3338&quot;
  [1] &quot;3350&quot;
  [1] &quot;3358&quot;
  [1] &quot;3378&quot;
  [1] &quot;3395&quot;
  [1] &quot;3402&quot;
  [1] &quot;3875&quot;
  [1] &quot;3950&quot;
  [1] &quot;3988&quot;
  [1] &quot;4018&quot;
  [1] &quot;4039&quot;
  [1] &quot;4048&quot;
  [1] &quot;4057&quot;
  [1] &quot;4062&quot;
  [1] &quot;4067&quot;
  [1] &quot;4076&quot;
  [1] &quot;4082&quot;
  [1] &quot;4085&quot;
  [1] &quot;4092&quot;
  [1] &quot;4098&quot;
  [1] &quot;4099&quot;
  [1] &quot;4101&quot;
  [1] &quot;4107&quot;
  [1] &quot;4119&quot;
  [1] &quot;4139&quot;
  [1] &quot;4164&quot;
  [1] &quot;4231&quot;
  [1] &quot;4347&quot;
  [1] &quot;4559&quot;
  </code></pre>