Re: [R] Differenciate numbers from reference for rows

2010-10-30 Thread David Winsemius
On Oct 29, 2010, at 11:16 PM, Dennis Murphy wrote: Hi: x - matrix(20:35, ncol = 1) u - c(1, 4, 5, 6, 11) # 'x values' m - c(1, 3, 1, 1, 0.5) # Function to compute the inner product of the multipliers with the extracted # elements of x determined by u f - function(mat, inputs, mults)

Re: [R] Differenciate numbers from reference for rows

2010-10-30 Thread Gabor Grothendieck
On Fri, Oct 29, 2010 at 6:54 PM, M.Ribeiro mresende...@yahoo.com.br wrote: So, I am having a tricky reference file to extract information from. The format of the file is x   1 + 4 * 3 + 5 + 6 + 11 * 0.5 So, the elements that are not being multiplied (1, 5 and 6) and the elements before

Re: [R] Differenciate numbers from reference for rows

2010-10-30 Thread David Winsemius
On Oct 30, 2010, at 8:42 AM, Gabor Grothendieck wrote: On Fri, Oct 29, 2010 at 6:54 PM, M.Ribeiro mresende...@yahoo.com.br wrote: So, I am having a tricky reference file to extract information from. The format of the file is x 1 + 4 * 3 + 5 + 6 + 11 * 0.5 So, the elements that are not

Re: [R] Differenciate numbers from reference for rows

2010-10-30 Thread Gabor Grothendieck
On Sat, Oct 30, 2010 at 9:43 AM, David Winsemius dwinsem...@comcast.net wrote: On Oct 30, 2010, at 8:42 AM, Gabor Grothendieck wrote: On Fri, Oct 29, 2010 at 6:54 PM, M.Ribeiro mresende...@yahoo.com.br wrote: So, I am having a tricky reference file to extract information from. The format

[R] Differenciate numbers from reference for rows

2010-10-29 Thread M.Ribeiro
So, I am having a tricky reference file to extract information from. The format of the file is x 1 + 4 * 3 + 5 + 6 + 11 * 0.5 So, the elements that are not being multiplied (1, 5 and 6) and the elements before the multiplication sign (4 and 11) means actually the reference for the row in a

Re: [R] Differenciate numbers from reference for rows

2010-10-29 Thread Dennis Murphy
Hi: x - matrix(20:35, ncol = 1) u - c(1, 4, 5, 6, 11) # 'x values' m - c(1, 3, 1, 1, 0.5) # Function to compute the inner product of the multipliers with the extracted # elements of x determined by u f - function(mat, inputs, mults) crossprod(mat[inputs], mults) f(x, u, mults = c(1, 3, 1,