No return in function in R : <pre><code>&gt; B_linkages &lt;- function (J,j) {sum((X-X_omit(J,j))/X[j+56*(J-1)])}
&gt; B_linkages(1,1)
[1] 0.9723767
</code></pre>

<p>This one works just fine but</p>

<pre><code>&gt; B_linkages_inter &lt;- function (I,J) {
+   for (j in 1:56) {
+     for (i in 1:56) {
+       sum((X[i+56*(I-1)]-X_omit(J,j)[i+56*(I-1)])/X[j+56*(J-1)])
+     }
+   }
+ }
&gt; 
&gt; B_linkages_inter(1,1)
&gt; 1+2
[1] 3
</code></pre>

<p>B_linkages_inter(1,1) does not return any output compared to the previous function. </p>

<pre><code>&gt; 1+2
[1] 3 
</code></pre>

<p>is what I did to check if the R has stopped or not. Why isn't "B_linkages_inter(1,1)" showing any results?
X is an 2464*2464 matrix, X_omit(J,j) is a function which generates a matrix using the inverse of a 2464*2464 matrix.</p>
