Re: [R] Matrix Operations

2010-11-27 Thread Wu Gong
Hi Romildo, Merge two table by id2 first, then reshape to the wide format, sum by source at last. Hope it helps. ### Data simulation lsp.text <- " id source destiny id2 caminho order 1 1 2 4 7 0 0 2 2 6 10 4 0 0 3 3 6

Re: [R] Matrix operations

2010-06-28 Thread Dmitrij Kudriavcev
But isn't it change multiplication order? WBR Dima 2010/6/29 > Since X is a vector, then > > A <- sum(X, solve(V, X)) > > is probably slightly better here. > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Dmitrij Kudriavcev

Re: [R] Matrix operations

2010-06-28 Thread Bill.Venables
Oops. Try A <- sum(X * solve(V, X)) (too fast!) -Original Message- From: Venables, Bill (CMIS, Cleveland) Sent: Tuesday, 29 June 2010 1:05 PM To: 'Dmitrij Kudriavcev'; 'r-help@r-project.org' Subject: RE: [R] Matrix operations Since X is a vector, then A <

Re: [R] Matrix operations

2010-06-28 Thread Bill.Venables
Since X is a vector, then A <- sum(X, solve(V, X)) is probably slightly better here. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dmitrij Kudriavcev Sent: Tuesday, 29 June 2010 12:29 PM To: r-help@r-project.org Subject: [R] Ma

Re: [R] matrix operations on grobs and grid units

2009-09-19 Thread baptiste auguie
A few amendments might make this improved code more readable, e = expression(alpha,"testing very large width", hat(beta), integral(f(x)*dx, a, b)) library(grid) rowMax.units <- function(u, nrow){ # rowMax with a fake matrix of units  matrix.indices <- matrix(seq_along(u), nrow=nrow)  do.call(uni