Hi I have a data file like this sample:
a<-tribble(
~s.no,~a,~b,~volume,
1,51,52,200,
2,52,51,500,
3,51,58,44,
4,58,51,22
)
What is this table ?
The rows tell the volume in each road in both the directions. Eg: s.no 1 shows volume on road 51 to 52, similarly s.no, 2, shows volume on the smae link but in reverse direction: 52 to 51.
What i want ?
I want volume on both directions to be summed up into one, eg: road 51 to 52 should have 200+500 as volume. is it possible in R ? The following is the sample illustration of what i expect as a output.
