The indendation is not needed in the `code-block` and `ipython` blocks. So you can just begin the line with `.. code-block:: r` and then indent the following code just with 1 level. 
And this is also for all following code-blocks.