Hey all!

I have a time series dataset like this:

Date    Time   Var
1            1        2
1           1        4
1           1         5
1          2          8
1          2          8
1         2           9
2        1            3
2        1              4
2        1            4

I created a unique id for each row:
dat$UniqueID <- paste(dat$Date,dat$Time, sep = '_')

then

aggregate(dat$Var, list(dat$UniqueID), sum)

however the final output is not in ideal order I look for (I simply this
example provided above).I would like to have order like this:

1_1
1_2
2_1

Thanks for your help!

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to