There are two matrices that I want to divide: numer1 and denom1. The problem is that they are of unequal row lengths. The script is run every week, so the dimensions change weekly, too.
This week:
dim(numer1) = 998 rows, 99 columns
dim(denom1) = 997 rows, 99 columns.
Last week:
dim(numer1) = 999 rows, 99 columns
dim(denom1) = 998 rows, 99 columns.
Is there a way to compare these matrices and remove the last row in the larger matrix (in this example, numer1)?
Here’s what I have tried:
fun1 <- as.data.frame(abs(numer1[-last(numer1),]/denom1))
Thank you!
How about this: