There are a number of factors that can influence the rate of an $\mathrm{S_{N}2}$ reaction. Solvent, leaving group stability, attacking group nucleophilicity, steric factors and electronic factors.
In the series of compounds you've presented, all of these parameters are held constant except for the steric and electronic factors. Considering only steric factors for a moment we would order the compounds as P>S~R>Q. But now let's consider electronic factors.
Considering the allyl system in compound R, the transition state looks something like this
image source
The p orbitals in the adjacent double bond overlap with the p orbital at the $\mathrm{S_{N}2}$ reaction center (remember that $\mathrm{S_{N}2}$ transition states are roughly $\ce{sp^2}$ hybridized) and stabilizes the transition state through resonance delocalization. Note that the transition state is electron rich, there is a full unit of negative charge in the transition state.
When a carbonyl is placed next to the $\mathrm{S_{N}2}$ reaction center, we replace the $\ce{C=C}$ double bond in the above drawing with a $\ce{C=O}$ double bond. Again there is overlap and resonance stabilization of the transition state. But in the carbonyl case the stabilization is even greater than with the $\ce{C=C}$ double bond because the carbonyl carbon is positively polarized and inductively stabilizes the electron rich (remember that negative charge) transition state even more.
image source
While we would expect the allyl case (R) to be faster than the ethyl case, in your series of compounds apparently it is not faster than the methyl case.
(Note: often the allyl system will react a bit faster than the methyl analogue, but the two rates are usually close)
However, the additional inductive stabilization from the carbonyl allows it to react faster than the methyl compound so our final reactivity order becomes S>P>R>Q.