My data frame looks like this:
plant  distance
one      1
one      3
one      2
one      3
one      7
one      4
one      6
one      8
one      9
two      1
two      6
two      4
two      8
two      5
two      3
three ……
I want to split distance of each level into groups by interval(for instance,interval=3). 
plant  distance group
  one      1    1
  one      3    1
  one      2    1
  one      3    1
  one      7    3
  one      4    2
  one      6    2
  one      8    3
  one      9    3
  two      1    1
  two      6    2
  two      4    2
  two      8    3
  two      5    2
  two      3    1
  three ……
And compute percentage of each group
plant group percentage
one     1     0.44
one     2     0.22
one     3     0.33
two     1     0.33
two     2     0.50
two     3     0.17
three ……
Finally, plot the percentages of each level of each group similar like this:

and I do not know how to split each level by interval. Sorry for my English! Thank you for your help!
 
    
