Re: [R] using for variable as rowname

2008-09-18 Thread David Winsemius
On Sep 18, 2008, at 6:25 AM, Ralikwen wrote: Thanks for your help, I didn't know where you can or can't use a for variable. Seems that I have to use rownames to do this anyway, so finally I went for a more procedural solution: v=1:6 for (a in 1:3){ for (b in 4:5) { v<-rbind(v,1+a+b:

Re: [R] using for variable as rowname

2008-09-18 Thread Ralikwen
Thanks for your help, I didn't know where you can or can't use a for variable. Seems that I have to use rownames to do this anyway, so finally I went for a more procedural solution: v=1:6 for (a in 1:3){ for (b in 4:5) { v<-rbind(v,1+a+b:6+a+b) rownames(v)[nrow(v)]= paste(a,b,sep="

Re: [R] using for variable as rowname

2008-09-17 Thread Ted Harding
On 17-Sep-08 14:22:11, Ralikwen wrote: > > Is there a way to use the cycle variable for rowname? > > v=1:6 > for (a in 1:3){ > for (b in 4:5) { > v=rbind(v,a.b=1) > } > } > v > > This above obviously does not work, but I couldn't find out how to use > a and > b to construct a rowname like 1

Re: [R] using for variable as rowname

2008-09-17 Thread Richard . Cotton
> Is there a way to use the cycle variable for rowname? > > v=1:6 > for (a in 1:3){ > for (b in 4:5) { > v=rbind(v,a.b=1) > } > } > v > > This above obviously does not work, but I couldn't find out how to use a and > b to construct a rowname like 14, 15, 24, 25. Not pretty, but this does t

[R] using for variable as rowname

2008-09-17 Thread Ralikwen
Is there a way to use the cycle variable for rowname? v=1:6 for (a in 1:3){ for (b in 4:5) { v=rbind(v,a.b=1) } } v This above obviously does not work, but I couldn't find out how to use a and b to construct a rowname like 14, 15, 24, 25. Thanks for the help. Balazs -- View this message in