I have one data frame/ list that gives and ID and a number
1.  25
2.  36
3.  10
4.  18
5.  12
This first list is effectively a list of objects with the number of objects contained in each eg. bricks in a wall, so a a list or walls with the number of bricks in each. I have a second that contains a a full list of the objects being referred to in that above list and a second attribute for each.
1.   3
2.   4
3.   2
4.   8
5.   5
etc. in the weak example I'm stringing together this would be a list of the weight of each brick in all walls.
so my first list give me the ranges i would like to average in the second list, or I would like as an end result a list of walls with the average weight of each brick per wall.
ie average the attributes of 1-25, 26-62 ... 89-101
my idea so far was to create a data frame with two coloumns
1. 1 25
2. 26 62
3. n
4. n
5. 89 101
and then attempt to create a third column that uses the first two as x and y in a mean(table2$coloumn1[x:y]) type formula, but I can't get anything to work.
the end result could probably looks something like this
1.   3.2
2.   6.5
3.   3
4.   7.9
5.   8.5
is there a way to do it like this or does anyone have a more elegant solution.
 
    