title: Changing every other row in a matrix in R
body: <p>Would anyone be able to show me a way of changing every second row in a column of a matrix to have the opposite sign to the one it currently has (e.g. changing a 4 to -4, or a -4 to 4)? I can do it with a for loop, but I was hoping there might be a more efficient method for doing it.</p>