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
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
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 <
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
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
5 matches
Mail list logo