title: Error object of type 'closure' is not subsettable
body: <p>I have a Problem with the Programm R. 
  I have programmed this code and when I want to proceed it, I get the error message:</p>
  
  <blockquote>
    <p>Error in daten.asset[[s]] : object of type 'closure' is not subsettable.</p>
  </blockquote>
  
  <p>I'm quite unknown with programming and struggle pretty hard sometimes.
  Can anybody help me?  </p>
  
  <p>Thanks for any try.</p>
  
  <p>My Code: </p>
  
  <pre><code>r.M.ZR &lt;- arima.sim(model=list(ar=0.6), n = 1100) ;
  r.M &lt;-as.vector(r.M.ZR,mode="numeric" );
  tilde.r.M &lt;- r.M - mean(r.M)
  M &lt;- matrix(c(tilde.r.M, tilde.r.M),2,1100)
  
  A=matrix(c(0.5,0,0,0.5),2,2)
  
  X &lt;- c(0,rnorm(1400, 0, 0.5))           
  Y &lt;- c(0,rnorm(1400, 0, 0.5))
  
  Zeta=matrix(0,2,1401)     
  Zeta[1,]=X
  Zeta[2,]=Y                         
  
  epsilon=matrix(0,2,1401)
  epsilon[,1]=0                    
  
  for (i in 2:1401){
    epsilon[,i]=A%*%epsilon[,i-1] + Zeta[,i]
  }
  
  epsilon=epsilon[,302:1401]          
  alpha &lt;- vector(mode="numeric", length= 1100)
  beta &lt;- rep(1, 1100)
  
  
  daten.asset&lt;-function(){
    da&lt;-vector(mode="list",length=s);
    for (s in 1:2500) {  
    r.i1.ZR &lt;- alpha + beta %*% r.iM[,1] + epsilon;
    r.i1 &lt;-as.vector(r.i1.ZR,mode="numeric" );
    r.i2.ZR&lt;- alpha + beta %*% r.iM[,2] + epsilon;
    r.i2 &lt;-as.vector(r.i2.ZR,mode="numeric" );
    A[s] &lt;- matrix(c(r.i1, r.i2),2,1100)
    print(i)
    }; #for
  return(da)
  }
  
  for(s in 1:2500){
  mu.1 &lt;- hubers(daten.asset[[s]][1,1:100], k=1.5, s=1)$mu
  mu.2 &lt;- hubers(daten.asset[[s]][2,1:100], k=1.5, s=1)$mu
  
  epsilon.dach.1 &lt;- daten.asset[[s]][1,1:100] - mu.1
  epsilon.dach.2 &lt;- daten.asset[[s]][2,1:100] - mu.2
  
  epsilon.dach &lt;- matrix(c(epsilon.dach.1,epsilon.dach.2),2,100)}
  
  huber.psi &lt;- function(x, k=1.345) ifelse(abs(x) &lt; k, 2*x, 2*k*sign(x))
  psi.epsilon1 &lt;- huber.psi(epsilon1)
  psi.epsilon2 &lt;- huber.psi(epsilon2)
  
  
  psi.epsilon &lt;- matrix(c(psi.epsilon1,psi.epsilon2),2,100)
  </code></pre>