I've two data.tables as shown below:
***
N = 10
A.DT - data.table(a1 = c(rnorm(N,0,1)), a2 = NA))
B.DT - data.table(b1 = c(rnorm(N,0,1)), b2 = 1:N)
setkey(A.DT,a1)
setkey(B.DT,b1)
***
I tried to change my previous data.frame implementation to a
data.table implementation by changing the for-loop
],
A.DT[nrow(A.DT):1, a2]), na.last=FALSE))
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Matteo Richiardi
Sent: Dienstag, 19. März 2013 08:24
To: r-help@r-project.org
Subject: [R] How can I eliminate a loop over
I've two data.tables as shown below:
***
N = 10
A.DT - data.table(a1 = c(rnorm(N,0,1)), a2 = NA))
B.DT - data.table(b1 = c(rnorm(N,0,1)), b2 = 1:N)
setkey(A.DT,a1)
setkey(B.DT,b1)
***
I tried to change my previous data.frame implementation to a
data.table implementation by changing the for-loop
3 matches
Mail list logo