Help with FOR-loop

I thought I recognised this, ... Help with basic subsetting - General - RStudio Community