R Setting up an if statement inside a for loop I am extremely new to learning coding so please be patient with me.