Re: [R] Possible Improvement of the R code

2012-09-17 Thread William Dunlap
inal Message- > From: William Dunlap > Sent: Monday, September 17, 2012 8:53 AM > To: 'Berend Hasselman'; li li > Cc: r-help > Subject: RE: [R] Possible Improvement of the R code > > Unlike C or C++, subscripting vector or matrix is not almost free. > Also, subscri

Re: [R] Possible Improvement of the R code

2012-09-17 Thread William Dunlap
Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Berend Hasselman > Sent: Sunday, September 16, 2012 9:28 PM > To: li li > Cc: r-help > Subject: Re: [R] Possible Improvement of the R code > > > On 17

Re: [R] Possible Improvement of the R code

2012-09-16 Thread Berend Hasselman
On 17-09-2012, at 00:51, li li wrote: > Dear all, > In the following code, I was trying to compute each row of the "param" > iteratively based > on the first row. > This likely is not the best way. Can anyone suggest a simpler way to > improve the code. > Thanks a lot! > Hannah > >

[R] Possible Improvement of the R code

2012-09-16 Thread li li
Dear all, In the following code, I was trying to compute each row of the "param" iteratively based on the first row. This likely is not the best way. Can anyone suggest a simpler way to improve the code. Thanks a lot! Hannah param <- matrix(0, 11, 5) colnames(param) <- c("p", "