Skip to contents

Divides a column by its value in a reference row (the first row by default, or the row where at_column equals at), for curves shown relative to their first point.

Usage

PlotDataRelative(data, column, at_column = NULL, at = NULL, into = column)

Arguments

data

A data frame.

column

Column to scale.

at_column, at

Optional reference row selector.

into

Name of the result column; default column.

Value

data with the scaled column.

Examples

PlotDataRelative(data.frame(k = 4:6, inertia = c(50, 40, 30)), "inertia", into = "relative")
#>   k inertia relative
#> 1 4      50      1.0
#> 2 5      40      0.8
#> 3 6      30      0.6