Re: [R] "invalid times argument in rep function"

2012-10-16 Thread economicurtis
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

Re: [R] Sorting Panel Data by Time

2011-11-08 Thread economicurtis
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 =

[R] Sorting Panel Data by Time

2011-11-08 Thread economicurtis
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