Re: [R] sum rows in a data.frame...solution

2010-04-15 Thread David Winsemius
On Apr 15, 2010, at 5:33 AM, arnaud Gaboury wrote: Found this solution. It is maybe not the most elegant way, but it does the job. a=as.data.frame(substr(lme$DESCRIPTION,1,14)) colnames(a)=c("DESCRIPTION") lme=as.data.frame(c(a,lme[,2:3])) lme DESCRIPTION CLOSING.PRICE POSITION

Re: [R] sum rows in a data.frame

2010-04-15 Thread David Winsemius
On Apr 15, 2010, at 3:50 AM, arnaud Gaboury wrote: Dear group, Here is a data.frame, "lme": lme DESCRIPTION CLOSING.PRICE POSITION 4PRIMARY NICKEL USD 04/06/1025,755.71000 5PRIMARY NICKEL USD 10/06/1025,760.86000 6 PRM HGH GD

[R] sum rows in a data.frame...solution

2010-04-15 Thread arnaud Gaboury
Found this solution. It is maybe not the most elegant way, but it does the job. > a=as.data.frame(substr(lme$DESCRIPTION,1,14)) > colnames(a)=c("DESCRIPTION") > lme=as.data.frame(c(a,lme[,2:3])) > lme DESCRIPTION CLOSING.PRICE POSITION 1 PRIMARY NICKEL 25,755.71000 2

[R] sum rows in a data.frame

2010-04-15 Thread arnaud Gaboury
Dear group, Here is a data.frame, "lme": > lme DESCRIPTION CLOSING.PRICE POSITION 4PRIMARY NICKEL USD 04/06/1025,755.71000 5PRIMARY NICKEL USD 10/06/1025,760.86000 6 PRM HGH GD ALUMINIUM USD 09/07/10 2,415.90000 8 SPC