Here is a data frame I have and I want to compute the breteau index
## Here is the table
commune container house aegypti albopictus
yde4 c1 h1 6 6
yde2 c2 h2 2 3
yde7 c3 h3 1 0
yde7 c3 h4 1 1
yde7 c5 h5 8 0
yde7 c6 h6 0 0
yde4 c7 h7 4 1
yde7 c8 h8 14 9
yde3 c9 h9 0 1
yde3 c10 h10 6 2
## here is how it should display
aegypti albopictus
com house_pros c_found Pos_container In Pos_container In
yde2 1 1 1 100 1 100
yde3 2 2 1 50 2 100
yde4 2 2 2 100 2 100
yde7 4 5 4 100 2 40
Total 9 10 8 88 7 70
`com = commune, house_pros = number of house prospected, c_found = the number of container found in each commune, pos_container = the number of positive container (container where at least one either aegypti or albopictus was found) per commune and for each species (aegypti or albopictus) (taking into account that we may have more than one container in a house), and In = Breteau index computed ((number of positive container / number of house prospected)*100. The index is computed for each species and for each commune. And totals row and column are added.
I couldn't be able to find out the suitable code.
Could some one help me with the right one?