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

[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