utilsCalculateDistance: utilsCalculateDistance

View source: R/SRD_utility.R

utilsCalculateDistanceR Documentation

utilsCalculateDistance

Description

Calculates the distance of two rankings in $L_1$ norm and inserts the result after the first.

Usage

utilsCalculateDistance(df, nameCol, refCol)

Arguments

df

A DataFrame.

nameCol

The current Column of the iteration.

refCol

The reference Column of the dataFrame.

Value

Returns a new df that has a Distance Column based on the nameCol.

Author(s)

Ali Tugay Sen, Jochen Staudacher jochen.staudacher@hs-kempten.de

Examples

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)

rSRD documentation built on Nov. 2, 2024, 1:06 a.m.