I just looked up Peroxideperoxide on Google, and I saw that the oxidation state of Ooxygen in R-O-O-R$\ce{R-O-O-R}$ is -1$–1$, and not -2$–2$ (like H2O$\ce{H2O}$), when I could clearly see that each O atom forms two bonds. Did I get either of the concepts wrong?
I think that's probably the case but, can someone explain where I went wrong? To me, Valency dictates the no of bonds that an element can have. In the structure, I can clearly see that each Ooxygen forms 2$2$ bonds so, if I remove the other atoms, won't the imaginary charge left still be -2?$-2$? Then how, does -1$-1$ come into play?