utilsCalculateDistance | R Documentation |
Calculates the distance of two rankings in $L_1$ norm and inserts the result after the first.
utilsCalculateDistance(df, nameCol, refCol)
df |
A DataFrame. |
nameCol |
The current Column of the iteration. |
refCol |
The reference Column of the dataFrame. |
Returns a new df
that has a Distance Column based on the nameCol
.
Ali Tugay Sen, Jochen Staudacher jochen.staudacher@hs-kempten.de
SRDInput <- data.frame(
A=c(32, 52, 44, 44, 47),
B=c(73, 75, 65, 76, 70),
C=c(60, 59, 57, 55, 60),
D=c(35, 24, 44, 83, 47),
E=c(41, 52, 46, 50, 65))
nameCol <- "A"
refCol <- "B"
rSRD::utilsCalculateDistance(SRDInput,nameCol,refCol)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.