Dear All,
It is difficult to summarize the question in few words. So, please, 
look at the following example.
Thanks in advance,
domenico

----------------------------------------------------------------------------------------------------------------------------------------------------------
rm(list = ls())
posfix=1:5* 10
for(i in posfix)
        assign(paste("matX.",i,sep=""),matrix(0,3,2))
ls()

[1] "i"       "matX.10" "matX.20" "matX.30" "matX.40" "matX.50" "posfix"
AT THIS STEP I HAVE 5 MATRIX OF ZEROS (3 ROWS PER 2 COLUMNS)
NOW I WOULD LIKE TO ASSIGN TO A ROW OF THE  5 MATRICES A VALUE
RELATED TO THE INDEX OF A FOR LOOP

for(i in 1:length(posfix))
        assign(paste("matX.",posfix[i],"[",i,",]",sep=""),i)
ls()

  [1] "i"           "matX.10"     "matX.10[1,]" "matX.20"     "matX.20[2,]"
  [6] "matX.30"     "matX.30[3,]" "matX.40"     "matX.40[4,]" "matX.50"
[11] "matX.50[5,]" "posfix"

??????????????????
WHY IT DOES NOT ASSIGN THE VALUE TO THE ROWS OF THE PRE-INITIALIZED
VARIABLES. WHERE IS MY ERROR?

______________________________________________
[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