I came seeking the answer to the same question.
Looking over my work, the equation I had to deliver the "times" variable (in
rep, the "integer vector giving the (non-negative) number of times to repeat
each element" , and seeking to replicate a number NaN times too.
Thanks!
--
View this mess
le data:
>
> # plyr
> library('plyr')
> ddply(df, .(TIME), mutate, L1 = sort(S1))
>
> # Another way with the data.table package:
> library('data.table')
> dt <- data.table(df, key = 'TIME')
> dt[, list(X1, S1, L1 = sort(S1)), by =
I have panel data in the following form:
TIME X1 S1
1 1 0.99
1 2 0.50
1 3 0.01
2 3 0.99
2 1 0.99
2 2 0.25
3 3 0.75
3 2 0.50
3 1 0.25
... ... ..
And desire a new vector o
3 matches
Mail list logo