To divide one row of a DataFrame with all values in a certain column by another row's values in the same column in R, we can use the following code:
main.r141 chars6 lines
This code divides value in df
's first row and column "B" by the value in the second row and column "B". To divide an entire row, we can use the following code:
main.r71 chars3 lines
This code divides all columns in the first row of df
by the corresponding values in the second row.
gistlibby LogSnag