Hi,
Can any one please explain why the following code doesn't work? Or can anyone suggest an alternative. Suppose x<-c(23,67,2,87,9,63,8,2,35,6,91,41,22,3) mat<-0; for(j in 1:length(x)) { for(i in 1:p) mat[i,j]<-x[j]^i; } Actually I want to have a matrix with p columns such that each column will have the elements of x^(column#). Thanks in advance. Bhargab [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.