Re: [R] Using loops to create matrices where the variables is called with $

2012-07-09 Thread Rui Barradas
Hello, I'm not completely sure I understand your problem, you should say what is the package you are using. If it's just a doubt on how to access the elements of what seems to be a list, here is an example: x <- list(a=1:5, b=rnorm(4)) x$a x[[ "a" ]] x[[ 1 ]] If it's from package vars, th

[R] Using loops to create matrices where the variables is called with $

2012-07-09 Thread Drew Harris
Hi there, I am trying to make a VECM model which does a loop to pull of long run impact coefficients. The problem is that to calculate these for a,b,c I use the irf() function and they are stored in irf$a, irf$b, irf$c. What I would really like is to be able to call irf$[variablename(x)] where I c