Array: subtract by row
Use sweep
to operate on a particular margin of the array: rows are the second dimension (margin).
sweep(a,MARGIN=2,c(1,5),FUN="-")
Use sweep
to operate on a particular margin of the array: rows are the second dimension (margin).
sweep(a,MARGIN=2,c(1,5),FUN="-")