Hello,

It's a trivial question but I haven't found a solution in the
full reference manual. How can I make the code below run? Would
an array/matrix solution be faster? Please provide a short
example, if possible.

Thanks in advance,
dan

for (k in 1:5) 
        assign(paste("f",k,sep=""),vector(mode="complex",5))
for (k in 1:5) {
        for(j in 1:5) 
                f[k][[j]] <- sum(d$Y[k]*exp(-1i*j*d$X)) }
Error: Object "f" not found

(I want f[k] to become f1,...,f5; and d$Y[k] should be
d$Y1,...,d$Y5.)

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to